2011-10-14 23:38:50 +02:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
2022-01-10 00:50:54 +01:00
|
|
|
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
|
2011-10-14 23:38:50 +02:00
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;; VGA.INC ;;
|
|
|
|
;; ;;
|
|
|
|
;; 640x480 mode 0x12 VGA functions for MenuetOS ;;
|
|
|
|
;; ;;
|
|
|
|
;; Paul Butcher, paul.butcher@asa.co.uk ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
$Revision$
|
|
|
|
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
paletteVGA:
|
|
|
|
|
|
|
|
;16 colour palette
|
|
|
|
mov dx, 0x3c8
|
|
|
|
mov al, 0
|
|
|
|
out dx, al
|
|
|
|
|
|
|
|
mov ecx, 16
|
|
|
|
mov dx, 0x3c9
|
|
|
|
xor eax, eax
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
palvganew:
|
2011-10-14 23:38:50 +02:00
|
|
|
mov al, 0
|
|
|
|
test ah, 4
|
|
|
|
jz palvgalbl1
|
|
|
|
add al, 31
|
|
|
|
test ah, 8
|
|
|
|
jz palvgalbl1
|
|
|
|
add al, 32
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
palvgalbl1:
|
2011-10-14 23:38:50 +02:00
|
|
|
out dx, al; red 0,31 or 63
|
|
|
|
mov al, 0
|
|
|
|
test ah, 2
|
|
|
|
jz palvgalbl2
|
|
|
|
add al, 31
|
|
|
|
test ah, 8
|
|
|
|
jz palvgalbl2
|
|
|
|
add al, 32
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
palvgalbl2:
|
2011-10-14 23:38:50 +02:00
|
|
|
out dx, al; blue 0,31 or 63
|
|
|
|
mov al, 0
|
|
|
|
test ah, 1
|
|
|
|
jz palvgalbl3
|
|
|
|
add al, 31
|
|
|
|
test ah, 8
|
|
|
|
jz palvgalbl3
|
|
|
|
add al, 32
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
palvgalbl3:
|
2011-10-14 23:38:50 +02:00
|
|
|
out dx, al; green 0,31 or 63
|
|
|
|
add ah, 1
|
|
|
|
loop palvganew
|
|
|
|
; mov dx, 3ceh
|
|
|
|
; mov ax, 0005h
|
|
|
|
; out dx, ax
|
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
palette320x200:
|
|
|
|
mov edx, 0x3c8
|
|
|
|
xor eax, eax
|
|
|
|
out dx, al
|
|
|
|
mov ecx, 256
|
|
|
|
mov edx, 0x3c9
|
|
|
|
xor eax, eax
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
palnew:
|
2011-10-14 23:38:50 +02:00
|
|
|
mov al, 0
|
|
|
|
test ah, 64
|
|
|
|
jz pallbl1
|
|
|
|
add al, 21
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
pallbl1:
|
2011-10-14 23:38:50 +02:00
|
|
|
test ah, 128
|
|
|
|
jz pallbl2
|
|
|
|
add al, 42
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
pallbl2:
|
2011-10-14 23:38:50 +02:00
|
|
|
out dx, al
|
|
|
|
mov al, 0
|
|
|
|
test ah, 8
|
|
|
|
jz pallbl3
|
|
|
|
add al, 8
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
pallbl3:
|
2011-10-14 23:38:50 +02:00
|
|
|
test ah, 16
|
|
|
|
jz pallbl4
|
|
|
|
add al, 15
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
pallbl4:
|
2011-10-14 23:38:50 +02:00
|
|
|
test ah, 32
|
|
|
|
jz pallbl5
|
|
|
|
add al, 40
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
pallbl5:
|
2011-10-14 23:38:50 +02:00
|
|
|
out dx, al
|
|
|
|
mov al, 0
|
|
|
|
test ah, 1
|
|
|
|
jz pallbl6
|
|
|
|
add al, 8
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
pallbl6:
|
2011-10-14 23:38:50 +02:00
|
|
|
test ah, 2
|
|
|
|
jz pallbl7
|
|
|
|
add al, 15
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
pallbl7:
|
2011-10-14 23:38:50 +02:00
|
|
|
test ah, 4
|
|
|
|
jz pallbl8
|
|
|
|
add al, 40
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
pallbl8:
|
2011-10-14 23:38:50 +02:00
|
|
|
out dx, al
|
|
|
|
add ah, 1
|
|
|
|
loop palnew
|
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
2011-10-14 23:38:50 +02:00
|
|
|
align 4
|
|
|
|
uglobal
|
|
|
|
novesachecksum dd 0x0
|
|
|
|
EGA_counter db 0
|
|
|
|
VGA_drawing_screen db 0
|
|
|
|
VGA_8_pixels:
|
|
|
|
rb 16
|
|
|
|
temp:
|
|
|
|
.cx dd 0
|
|
|
|
endg
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
2011-10-14 23:38:50 +02:00
|
|
|
align 4
|
|
|
|
checkVga_N13:
|
2013-06-05 11:29:50 +02:00
|
|
|
cmp [SCR_MODE], 0x13
|
2011-10-14 23:38:50 +02:00
|
|
|
jne @f
|
|
|
|
|
|
|
|
pushad
|
|
|
|
cmp [EGA_counter], 1
|
|
|
|
je novesal
|
|
|
|
mov ecx, [MOUSE_X]
|
|
|
|
cmp ecx, [novesachecksum]
|
|
|
|
jne novesal
|
|
|
|
popad
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
2011-10-14 23:38:50 +02:00
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
novesal:
|
2011-10-14 23:38:50 +02:00
|
|
|
mov [novesachecksum], ecx
|
2022-01-10 00:50:54 +01:00
|
|
|
xor ecx, ecx ;mov ecx, 0
|
2011-10-14 23:38:50 +02:00
|
|
|
movzx eax, word [MOUSE_Y]
|
|
|
|
cmp eax, 100
|
|
|
|
jge m13l3
|
|
|
|
mov eax, 100
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
m13l3:
|
2011-10-14 23:38:50 +02:00
|
|
|
cmp eax, 480-100
|
|
|
|
jbe m13l4
|
|
|
|
mov eax, 480-100
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
m13l4:
|
2011-10-14 23:38:50 +02:00
|
|
|
sub eax, 100
|
|
|
|
imul eax, 640*4
|
|
|
|
add ecx, eax
|
|
|
|
movzx eax, word [MOUSE_X]
|
|
|
|
cmp eax, 160
|
|
|
|
jge m13l1
|
|
|
|
mov eax, 160
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
m13l1:
|
2011-10-14 23:38:50 +02:00
|
|
|
cmp eax, 640-160
|
|
|
|
jbe m13l2
|
|
|
|
mov eax, 640-160
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
m13l2:
|
2011-10-14 23:38:50 +02:00
|
|
|
sub eax, 160
|
|
|
|
shl eax, 2
|
|
|
|
add ecx, eax
|
|
|
|
mov esi, [LFBAddress]
|
|
|
|
add esi, ecx
|
|
|
|
mov edi, VGABasePtr
|
|
|
|
mov edx, 200
|
|
|
|
mov ecx, 320
|
|
|
|
cld
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
m13pix:
|
2011-10-14 23:38:50 +02:00
|
|
|
lodsd
|
|
|
|
test eax, eax
|
|
|
|
jz .save_pixel
|
|
|
|
push eax
|
|
|
|
mov ebx, eax
|
|
|
|
and eax, (128+64+32) ; blue
|
|
|
|
shr eax, 5
|
|
|
|
and ebx, (128+64+32)*256; green
|
|
|
|
shr ebx, 8+2
|
|
|
|
add eax, ebx
|
|
|
|
pop ebx
|
|
|
|
and ebx, (128+64)*256*256; red
|
|
|
|
shr ebx, 8+8
|
|
|
|
add eax, ebx
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.save_pixel:
|
2011-10-14 23:38:50 +02:00
|
|
|
stosb
|
|
|
|
loop m13pix
|
|
|
|
mov ecx, 320
|
|
|
|
add esi, 4*(640-320)
|
|
|
|
dec edx
|
|
|
|
jnz m13pix
|
|
|
|
mov [EGA_counter], 0
|
|
|
|
popad
|
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
VGA_drawbackground:
|
|
|
|
; draw all
|
|
|
|
pushad
|
|
|
|
mov esi, [LFBAddress]
|
|
|
|
mov edi, VGABasePtr
|
|
|
|
mov ebx, 640/32; 640*480/(8*4)
|
|
|
|
mov edx, 480
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
2011-10-14 23:38:50 +02:00
|
|
|
push ebx edx esi edi
|
|
|
|
shl edx, 9
|
2022-02-12 18:27:41 +01:00
|
|
|
lea edx, [edx + edx*4]
|
2011-10-14 23:38:50 +02:00
|
|
|
add esi, edx
|
|
|
|
shr edx, 5
|
|
|
|
add edi, edx
|
|
|
|
call VGA_draw_long_line
|
|
|
|
pop edi esi edx ebx
|
|
|
|
dec edx
|
|
|
|
jnz @r
|
|
|
|
call VGA_draw_long_line_1
|
|
|
|
popad
|
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
VGA_draw_long_line:
|
|
|
|
mov dx, 3ceh
|
|
|
|
mov ax, 0ff08h
|
|
|
|
cli
|
|
|
|
out dx, ax
|
|
|
|
mov ax, 0005h
|
|
|
|
out dx, ax
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
m12pix:
|
2011-10-14 23:38:50 +02:00
|
|
|
call VGA_draw_32_pixels
|
|
|
|
dec ebx
|
|
|
|
jnz m12pix
|
|
|
|
mov dx, 3c4h
|
|
|
|
mov ax, 0ff02h
|
|
|
|
out dx, ax
|
|
|
|
mov dx, 3ceh
|
|
|
|
mov ax, 0205h
|
|
|
|
out dx, ax
|
|
|
|
mov dx, 3ceh
|
|
|
|
mov al, 08h
|
|
|
|
out dx, al
|
|
|
|
sti
|
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
VGA_draw_32_pixels:
|
|
|
|
xor eax, eax
|
|
|
|
mov ebp, VGA_8_pixels
|
|
|
|
mov [ebp], eax
|
|
|
|
mov [ebp+4], eax
|
|
|
|
mov [ebp+8], eax
|
|
|
|
mov [ebp+12], eax
|
|
|
|
mov ch, 4
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.main_loop:
|
2011-10-14 23:38:50 +02:00
|
|
|
mov cl, 8
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.convert_pixels_to_VGA:
|
2011-10-14 23:38:50 +02:00
|
|
|
lodsd ; eax = 24bit colour
|
|
|
|
test eax, eax
|
|
|
|
jz .end
|
|
|
|
rol eax, 8
|
|
|
|
mov al, ch
|
|
|
|
ror eax, 8
|
|
|
|
mov ch, 1
|
|
|
|
dec cl
|
|
|
|
shl ch, cl
|
|
|
|
cmp al, 85
|
|
|
|
jbe .p13green
|
|
|
|
or [ebp], ch
|
|
|
|
cmp al, 170
|
|
|
|
jbe .p13green
|
|
|
|
or [ebp+12], ch
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.p13green:
|
2011-10-14 23:38:50 +02:00
|
|
|
cmp ah, 85
|
|
|
|
jbe .p13red
|
|
|
|
or [ebp+4], ch
|
|
|
|
cmp ah, 170
|
|
|
|
jbe .p13red
|
|
|
|
or [ebp+12], ch
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.p13red:
|
2011-10-14 23:38:50 +02:00
|
|
|
shr eax, 8
|
|
|
|
cmp ah, 85
|
|
|
|
jbe .p13cont
|
|
|
|
or [ebp+8], ch
|
|
|
|
cmp ah, 170
|
|
|
|
jbe .p13cont
|
|
|
|
or [ebp+12], ch
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.p13cont:
|
2011-10-14 23:38:50 +02:00
|
|
|
ror eax, 8
|
|
|
|
mov ch, ah
|
|
|
|
inc cl
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.end:
|
2011-10-14 23:38:50 +02:00
|
|
|
dec cl
|
|
|
|
jnz .convert_pixels_to_VGA
|
|
|
|
inc ebp
|
|
|
|
dec ch
|
|
|
|
jnz .main_loop
|
|
|
|
push esi
|
|
|
|
sub ebp, 4
|
|
|
|
mov esi, ebp
|
|
|
|
mov dx, 3c4h
|
|
|
|
mov ah, 1h
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
2011-10-14 23:38:50 +02:00
|
|
|
mov al, 02h
|
|
|
|
out dx, ax
|
|
|
|
xchg ax, bp
|
|
|
|
lodsd
|
|
|
|
mov [edi], eax
|
|
|
|
xchg ax, bp
|
|
|
|
shl ah, 1
|
|
|
|
cmp ah, 10h
|
|
|
|
jnz @r
|
|
|
|
add edi, 4
|
|
|
|
pop esi
|
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
VGA_putpixel:
|
|
|
|
; eax = x
|
|
|
|
; ebx = y
|
|
|
|
mov ecx, eax
|
2022-02-12 18:27:41 +01:00
|
|
|
mov eax, [esp + 32-8+4] ; color
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
2012-03-10 18:36:55 +01:00
|
|
|
; check for hardware cursor
|
|
|
|
cmp [_display.select_cursor], select_cursor
|
2012-03-11 21:36:29 +01:00
|
|
|
je @f
|
|
|
|
cmp [_display.select_cursor], 0
|
2012-03-10 18:36:55 +01:00
|
|
|
jne .no_mouseunder
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
2012-03-08 14:45:18 +01:00
|
|
|
push ecx
|
|
|
|
shl ecx, 16
|
|
|
|
mov cx, bx
|
|
|
|
; check mouse area for putpixel
|
|
|
|
test eax, 0x04000000
|
|
|
|
jnz @f
|
|
|
|
call [_display.check_mouse]
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
|
|
|
pop ecx
|
2012-03-10 18:36:55 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.no_mouseunder:
|
2011-10-14 23:38:50 +02:00
|
|
|
shl ebx, 9
|
2022-02-12 18:27:41 +01:00
|
|
|
lea ebx, [ebx + ebx*4] ; multiply by 5
|
|
|
|
lea edx, [ebx + ecx*4] ; + x*BytesPerPixel (Vesa2.0 32)
|
2011-10-14 23:38:50 +02:00
|
|
|
mov edi, edx
|
2020-07-16 21:31:16 +02:00
|
|
|
add edi, [LFBAddress] ; + LFB address
|
2011-10-14 23:38:50 +02:00
|
|
|
mov [edi], eax ; write to LFB for Vesa2.0
|
|
|
|
shr edx, 5 ; change BytesPerPixel to 1/8
|
|
|
|
mov edi, edx
|
2020-07-16 21:31:16 +02:00
|
|
|
add edi, VGABasePtr ; address of pixel in VGA area
|
2011-10-14 23:38:50 +02:00
|
|
|
and ecx, 0x07 ; bit no. (modulo 8)
|
|
|
|
pushfd
|
|
|
|
; edi = address, eax = 24bit colour, ecx = bit no. (modulo 8)
|
|
|
|
xor edx, edx
|
|
|
|
test eax, eax
|
|
|
|
jz .p13cont
|
|
|
|
cmp al, 85
|
|
|
|
jbe .p13green
|
|
|
|
or dl, 0x01
|
|
|
|
cmp al, 170
|
|
|
|
jbe .p13green
|
|
|
|
or dl, 0x08
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
.p13green:
|
|
|
|
cmp ah, 85
|
|
|
|
jbe .p13red
|
|
|
|
or dl, 0x02
|
|
|
|
cmp ah, 170
|
|
|
|
jbe .p13red
|
|
|
|
or dl, 0x08
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
.p13red:
|
|
|
|
shr eax, 8
|
|
|
|
cmp ah, 85
|
|
|
|
jbe .p13cont
|
|
|
|
or dl, 0x04
|
|
|
|
cmp ah, 170
|
|
|
|
jbe .p13cont
|
|
|
|
or dl, 0x08
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
.p13cont:
|
|
|
|
ror edx, 8
|
|
|
|
inc cl
|
|
|
|
xor eax, eax
|
|
|
|
inc ah
|
|
|
|
shr ax, cl
|
|
|
|
mov dx, 3cfh
|
|
|
|
cli
|
|
|
|
out dx, al
|
|
|
|
mov al, [edi] ; dummy read
|
|
|
|
rol edx, 8
|
|
|
|
mov [edi], dl
|
|
|
|
popfd
|
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
VGA__putimage:
|
|
|
|
; ecx = size [x|y]
|
|
|
|
; edx = coordinates [x|y]
|
|
|
|
pushad
|
|
|
|
rol edx, 16
|
|
|
|
movzx eax, dx
|
|
|
|
rol edx, 16
|
|
|
|
movzx ebx, dx
|
|
|
|
movzx edx, cx
|
|
|
|
rol ecx, 16
|
|
|
|
movzx ecx, cx
|
|
|
|
call VGA_draw_bar_1
|
|
|
|
popad
|
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
VGA_draw_bar:
|
|
|
|
; eax cx
|
|
|
|
; ebx cy
|
|
|
|
; ecx xe
|
|
|
|
; edx ye
|
|
|
|
pushad
|
|
|
|
sub ecx, eax
|
|
|
|
sub edx, ebx
|
|
|
|
and eax, 0xffff
|
|
|
|
and ebx, 0xffff
|
|
|
|
and ecx, 0xffff
|
|
|
|
and edx, 0xffff
|
|
|
|
call VGA_draw_bar_1
|
|
|
|
popad
|
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
VGA_draw_bar_1:
|
|
|
|
mov [temp.cx], eax
|
2022-01-10 00:50:54 +01:00
|
|
|
mov eax, [current_slot_idx]
|
2022-02-12 18:27:41 +01:00
|
|
|
shl eax, BSF sizeof.WDATA
|
|
|
|
add ebx, [window_data + eax + WDATA.box.top]
|
|
|
|
mov eax, [window_data + eax + WDATA.box.left]
|
2011-10-14 23:38:50 +02:00
|
|
|
add eax, [temp.cx]
|
|
|
|
and eax, 0xfff8
|
|
|
|
shl ebx, 9
|
2022-02-12 18:27:41 +01:00
|
|
|
lea ebx, [ebx + ebx*4] ; multiply by 5
|
|
|
|
lea ebx, [ebx + eax*4] ; + x*BytesPerPixel (Vesa2.0 32)
|
2011-10-14 23:38:50 +02:00
|
|
|
mov esi, ebx
|
2020-07-16 21:31:16 +02:00
|
|
|
add esi, [LFBAddress] ; + LFB address
|
2011-10-14 23:38:50 +02:00
|
|
|
shr ebx, 5 ; change BytesPerPixel to 1/8
|
|
|
|
mov edi, ebx
|
|
|
|
add edi, VGABasePtr ; address of pixel in VGA area
|
|
|
|
mov ebx, ecx
|
|
|
|
shr ebx, 5
|
|
|
|
inc ebx
|
2012-03-08 14:45:18 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
.main_loop:
|
|
|
|
call VGA_draw_long_line_1
|
|
|
|
dec edx
|
|
|
|
jnz .main_loop
|
|
|
|
call VGA_draw_long_line_1
|
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2011-10-14 23:38:50 +02:00
|
|
|
VGA_draw_long_line_1:
|
|
|
|
push ebx edx esi edi
|
|
|
|
shl edx, 9
|
2022-02-12 18:27:41 +01:00
|
|
|
lea edx, [edx + edx*4]
|
2011-10-14 23:38:50 +02:00
|
|
|
add esi, edx
|
|
|
|
shr edx, 5
|
|
|
|
add edi, edx
|
|
|
|
call VGA_draw_long_line
|
|
|
|
pop edi esi edx ebx
|
|
|
|
ret
|
2012-03-08 14:45:18 +01:00
|
|
|
;------------------------------------------------------------------------------
|