forked from KolibriOS/kolibrios
Kolibri-A: new graph engine = BUGGY VERSION! =
git-svn-id: svn://kolibrios.org@1899 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
8ba9310247
commit
812af66c89
@ -85,7 +85,7 @@ CAPS_xTPR equ 46 ;
|
|||||||
CAPS_SYSCAL equ 64 ;
|
CAPS_SYSCAL equ 64 ;
|
||||||
CAPS_XD equ 65 ;execution disable
|
CAPS_XD equ 65 ;execution disable
|
||||||
CAPS_FFXSR equ 66 ;
|
CAPS_FFXSR equ 66 ;
|
||||||
CAPS_RDTSCP equ 67 ;
|
CAPS_RDTSCP equ 67 ; not used anywhere
|
||||||
CAPS_X64 equ 68 ;
|
CAPS_X64 equ 68 ;
|
||||||
CAPS_3DNOW equ 69 ;
|
CAPS_3DNOW equ 69 ;
|
||||||
CAPS_3DNOWEXT equ 70 ;
|
CAPS_3DNOWEXT equ 70 ;
|
||||||
@ -197,23 +197,23 @@ TASK_EVENT equ (OS_BASE+0x0003020)
|
|||||||
mouseunder equ (OS_BASE+0x0006900)
|
mouseunder equ (OS_BASE+0x0006900)
|
||||||
CDDataBuf equ (OS_BASE+0x0007000)
|
CDDataBuf equ (OS_BASE+0x0007000)
|
||||||
FLOPPY_BUFF equ (OS_BASE+0x0008000)
|
FLOPPY_BUFF equ (OS_BASE+0x0008000)
|
||||||
ACTIVE_PROC_STACK equ (OS_BASE+0x000A400) ;unused
|
;ACTIVE_PROC_STACK equ (OS_BASE+0x000A400) ;unused
|
||||||
idts equ (OS_BASE+0x000B100)
|
idts equ (OS_BASE+0x000B100)
|
||||||
WIN_STACK equ (OS_BASE+0x000C000)
|
WIN_STACK equ (OS_BASE+0x000C000)
|
||||||
WIN_POS equ (OS_BASE+0x000C400)
|
WIN_POS equ (OS_BASE+0x000C400)
|
||||||
FDD_BUFF equ (OS_BASE+0x000D000)
|
FDD_BUFF equ (OS_BASE+0x000D000)
|
||||||
|
|
||||||
;unused ? only one reference
|
;unused ? only one reference
|
||||||
ENABLE_TASKSWITCH equ (OS_BASE+0x000E000)
|
;ENABLE_TASKSWITCH equ (OS_BASE+0x000E000)
|
||||||
|
|
||||||
PUTPIXEL equ (OS_BASE+0x000E020)
|
;PUTPIXEL equ (OS_BASE+0x000E020)
|
||||||
GETPIXEL equ (OS_BASE+0x000E024)
|
;GETPIXEL equ (OS_BASE+0x000E024)
|
||||||
|
|
||||||
;unused ? only one reference
|
;unused ? only one reference
|
||||||
BANK_SWITCH equ (OS_BASE+0x000E030)
|
; BANK_SWITCH equ (OS_BASE+0x000E030) ; VESA 1.2 - not used
|
||||||
|
|
||||||
;unused ? store mousepointer
|
;unused ? store mousepointer
|
||||||
MOUSE_PICTURE equ (OS_BASE+0x000F200)
|
;MOUSE_PICTURE equ (OS_BASE+0x000F200) ; mousedrv.inc - not used
|
||||||
|
|
||||||
MOUSE_VISIBLE equ (OS_BASE+0x000F204)
|
MOUSE_VISIBLE equ (OS_BASE+0x000F204)
|
||||||
WIN_TEMP_XY equ (OS_BASE+0x000F300)
|
WIN_TEMP_XY equ (OS_BASE+0x000F300)
|
||||||
|
@ -413,9 +413,9 @@ MouseTickCounter rd 1
|
|||||||
|
|
||||||
;* end code - Mario79
|
;* end code - Mario79
|
||||||
|
|
||||||
img_background rd 1
|
;img_background rd 1
|
||||||
mem_BACKGROUND rd 1
|
;mem_BACKGROUND rd 1
|
||||||
static_background_data rd 1
|
;static_background_data rd 1
|
||||||
|
|
||||||
cache_ide0:
|
cache_ide0:
|
||||||
cache_ide0_pointer rd 1
|
cache_ide0_pointer rd 1
|
||||||
|
@ -51,14 +51,14 @@ dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
|
|||||||
cmp byte [edx], 0
|
cmp byte [edx], 0
|
||||||
jz .end
|
jz .end
|
||||||
; // Alver 22.06.2008 // {
|
; // Alver 22.06.2008 // {
|
||||||
cmp byte [esp+28], 1
|
cmp byte [esp+28], 1 ; was the entry point = dtext.1 ?
|
||||||
jne @f
|
jne @f
|
||||||
dec esi
|
dec esi
|
||||||
js .end
|
js .end
|
||||||
; } \\ Alver \\
|
; } \\ Alver \\
|
||||||
@@:
|
@@:
|
||||||
inc edx
|
inc edx
|
||||||
pushad
|
pushad ; esp -= 64 !
|
||||||
movzx edx, byte [edx-1]
|
movzx edx, byte [edx-1]
|
||||||
test ecx, 0x10000000
|
test ecx, 0x10000000
|
||||||
jnz .font2
|
jnz .font2
|
||||||
@ -71,14 +71,14 @@ dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
|
|||||||
shr dl, 1
|
shr dl, 1
|
||||||
jz .pixloop1end
|
jz .pixloop1end
|
||||||
jnc .nopix
|
jnc .nopix
|
||||||
call [putpixel]
|
call _putpixel
|
||||||
jmp .pixloop1cont
|
jmp .pixloop1cont
|
||||||
.nopix:
|
.nopix:
|
||||||
test ecx, 0x40000000
|
test ecx, 0x40000000
|
||||||
jz .pixloop1cont
|
jz .pixloop1cont
|
||||||
push ecx
|
push ecx
|
||||||
mov ecx, [esp+4+20h+20h]
|
mov ecx, [esp+4+20h+20h] ; original eax?
|
||||||
call [putpixel]
|
call _putpixel
|
||||||
pop ecx
|
pop ecx
|
||||||
.pixloop1cont:
|
.pixloop1cont:
|
||||||
inc eax
|
inc eax
|
||||||
@ -103,14 +103,14 @@ dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
|
|||||||
.pixloop2:
|
.pixloop2:
|
||||||
shr dl, 1
|
shr dl, 1
|
||||||
jnc .nopix2
|
jnc .nopix2
|
||||||
call [putpixel]
|
call _putpixel
|
||||||
jmp .pixloop2cont
|
jmp .pixloop2cont
|
||||||
.nopix2:
|
.nopix2:
|
||||||
test ecx, 0x40000000
|
test ecx, 0x40000000
|
||||||
jz .pixloop2cont
|
jz .pixloop2cont
|
||||||
push ecx
|
push ecx
|
||||||
mov ecx, [esp+12+20h+20h]
|
mov ecx, [esp+12+20h+20h]
|
||||||
call [putpixel]
|
call _putpixel
|
||||||
pop ecx
|
pop ecx
|
||||||
.pixloop2cont:
|
.pixloop2cont:
|
||||||
inc eax
|
inc eax
|
||||||
|
@ -518,11 +518,13 @@ mouse._.find_sys_window_under_cursor: ;////////////////////////////////////////
|
|||||||
;< esi = process slot
|
;< esi = process slot
|
||||||
;< edi = pointer to WDATA struct
|
;< edi = pointer to WDATA struct
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
mov esi, [Screen_Max_X]
|
mov esi, [mouse.state.pos.y]
|
||||||
inc esi
|
mov edi, [mouse.state.pos.x]
|
||||||
imul esi, [mouse.state.pos.y]
|
shr esi, 1
|
||||||
add esi, [_WinMapAddress]
|
shr edi, 2
|
||||||
add esi, [mouse.state.pos.x]
|
imul esi, [_WinMapWidth]
|
||||||
|
add edi, [_WinMapAddress]
|
||||||
|
add esi, edi
|
||||||
movzx esi, byte[esi]
|
movzx esi, byte[esi]
|
||||||
mov edi, esi
|
mov edi, esi
|
||||||
shl edi, 5
|
shl edi, 5
|
||||||
|
@ -12,7 +12,7 @@ $Revision$
|
|||||||
;///// public functions ///////////////////////////////////////////////////////
|
;///// public functions ///////////////////////////////////////////////////////
|
||||||
;==============================================================================
|
;==============================================================================
|
||||||
|
|
||||||
window.BORDER_SIZE = 5
|
window.BORDER_SIZE = 4
|
||||||
|
|
||||||
macro FuncTable name, table_name, [label]
|
macro FuncTable name, table_name, [label]
|
||||||
{
|
{
|
||||||
@ -336,11 +336,11 @@ syscall_move_window: ;///// system function 67 ////////////////////////////////
|
|||||||
@@: cmp edx, -1
|
@@: cmp edx, -1
|
||||||
jne @f
|
jne @f
|
||||||
mov edx, [edi + WDATA.box.width]
|
mov edx, [edi + WDATA.box.width]
|
||||||
and dl, 0xFC
|
; and dl, 0xFC
|
||||||
@@: cmp esi, -1
|
@@: cmp esi, -1
|
||||||
jne @f
|
jne @f
|
||||||
mov esi, [edi + WDATA.box.height]
|
mov esi, [edi + WDATA.box.height]
|
||||||
and esi, 0xFFFFFFFE
|
; and esi, 0xFFFFFFFE
|
||||||
|
|
||||||
@@: push esi edx ecx ebx
|
@@: push esi edx ecx ebx
|
||||||
mov eax, esp
|
mov eax, esp
|
||||||
@ -515,10 +515,10 @@ repos_windows: ;///////////////////////////////////////////////////////////////
|
|||||||
mov eax, [edi + WDATA.box.width]
|
mov eax, [edi + WDATA.box.width]
|
||||||
sub eax, ebx
|
sub eax, ebx
|
||||||
jle @f
|
jle @f
|
||||||
and bl, 0xFC ; <<<<<<<
|
; and bl, 0xFC ; <<<<<<<
|
||||||
mov [edi + WDATA.box.width], ebx
|
mov [edi + WDATA.box.width], ebx
|
||||||
@@: sub ebx, [edi + WDATA.box.width]
|
@@: sub ebx, [edi + WDATA.box.width]
|
||||||
and bl, 0xFC ; <<<<<<<
|
; and bl, 0xFC ; <<<<<<<
|
||||||
mov [edi + WDATA.box.left], ebx
|
mov [edi + WDATA.box.left], ebx
|
||||||
|
|
||||||
.fix_vertical:
|
.fix_vertical:
|
||||||
@ -530,10 +530,10 @@ repos_windows: ;///////////////////////////////////////////////////////////////
|
|||||||
mov eax, [edi + WDATA.box.height]
|
mov eax, [edi + WDATA.box.height]
|
||||||
sub eax, ebx
|
sub eax, ebx
|
||||||
jle @f
|
jle @f
|
||||||
and bl, 0xFE ; <<<<<<<
|
; and bl, 0xFE ; <<<<<<<
|
||||||
mov [edi + WDATA.box.height], ebx
|
mov [edi + WDATA.box.height], ebx
|
||||||
@@: sub ebx, [edi + WDATA.box.height]
|
@@: sub ebx, [edi + WDATA.box.height]
|
||||||
and bl, 0xFE ; <<<<<<<
|
; and bl, 0xFE ; <<<<<<<
|
||||||
mov [edi + WDATA.box.top], ebx
|
mov [edi + WDATA.box.top], ebx
|
||||||
jmp .fix_client_box
|
jmp .fix_client_box
|
||||||
|
|
||||||
@ -666,6 +666,7 @@ drawwindow_I_caption: ;////////////////////////////////////////////////////////
|
|||||||
add ebx, edx
|
add ebx, edx
|
||||||
mov eax, [esi + WDATA.box.left]
|
mov eax, [esi + WDATA.box.left]
|
||||||
inc eax
|
inc eax
|
||||||
|
|
||||||
shl eax, 16
|
shl eax, 16
|
||||||
add eax, [esi + WDATA.box.left]
|
add eax, [esi + WDATA.box.left]
|
||||||
add eax, [esi + WDATA.box.width]
|
add eax, [esi + WDATA.box.width]
|
||||||
@ -1455,9 +1456,9 @@ window._.sys_set_window: ;/////////////////////////////////////////////////////
|
|||||||
movzx eax, cx
|
movzx eax, cx
|
||||||
mov [edi + WDATA.box.height], eax
|
mov [edi + WDATA.box.height], eax
|
||||||
sar ebx, 16
|
sar ebx, 16
|
||||||
and bl, 0xFC ; <<<<<<<<
|
; and bl, 0xFC ; <<<<<<<<
|
||||||
sar ecx, 16
|
sar ecx, 16
|
||||||
and cl, 0xFE ; <<<<<<<<
|
; and cl, 0xFE ; <<<<<<<<
|
||||||
mov [edi + WDATA.box.left], ebx
|
mov [edi + WDATA.box.left], ebx
|
||||||
mov [edi + WDATA.box.top], ecx
|
mov [edi + WDATA.box.top], ecx
|
||||||
|
|
||||||
@ -1647,6 +1648,7 @@ virtual at esp
|
|||||||
ff_width dd ?
|
ff_width dd ?
|
||||||
ff_xsz dd ?
|
ff_xsz dd ?
|
||||||
ff_ysz dd ?
|
ff_ysz dd ?
|
||||||
|
ff_map dd ?
|
||||||
ff_scale dd ?
|
ff_scale dd ?
|
||||||
end virtual
|
end virtual
|
||||||
|
|
||||||
@ -1673,39 +1675,40 @@ end virtual
|
|||||||
sub edx, ebx
|
sub edx, ebx
|
||||||
inc ecx
|
inc ecx
|
||||||
inc edx
|
inc edx
|
||||||
|
shr ecx, 2 ; 1 tile = 4 pix
|
||||||
|
shr edx, 1 ; 1 tile = 2 lines
|
||||||
|
|
||||||
; get WinMap start
|
; get WinMap start
|
||||||
push esi
|
push esi
|
||||||
mov edi, [_WinMapWidth]
|
mov edi, [_WinMapWidth]
|
||||||
mov esi, edi
|
mov esi, edi
|
||||||
|
shr ebx, 1
|
||||||
imul edi, ebx
|
imul edi, ebx
|
||||||
shr eax, 1
|
shr eax, 2
|
||||||
shr eax, 1
|
|
||||||
add edi, eax
|
add edi, eax
|
||||||
add edi, [_WinMapAddress]
|
add edi, [_WinMapAddress]
|
||||||
pop eax
|
pop eax ; al = process#
|
||||||
mov ah, al
|
; mov ah, al
|
||||||
push ax
|
; push ax
|
||||||
shl eax, 16
|
; shl eax, 16
|
||||||
pop ax
|
; pop ax ; eax = 4 dup PROCESS_NUM
|
||||||
|
|
||||||
|
sub esi, ecx ; map line increment (bytes)
|
||||||
|
mov ebx, ecx ; map line width
|
||||||
.next_line:
|
.next_line:
|
||||||
push ecx
|
; shr ecx, 2 ; 1dword = 4 tiles
|
||||||
shr ecx, 2
|
; rep stosd ; filling the screen map
|
||||||
rep stosd
|
; mov ecx, ebx
|
||||||
mov ecx, [esp]
|
; and ecx, 3 ; 0 to 3 tiles remaining
|
||||||
and ecx, 3
|
|
||||||
rep stosb
|
rep stosb
|
||||||
pop ecx
|
mov ecx, ebx
|
||||||
add edi, esi
|
add edi, esi
|
||||||
sub edi, ecx
|
|
||||||
dec edx
|
dec edx
|
||||||
jnz .next_line
|
jnz .next_line
|
||||||
|
|
||||||
jmp .exit
|
jmp .exit
|
||||||
|
|
||||||
.shaped_window:
|
.shaped_window:
|
||||||
; for (y=0; y <= x_size; y++)
|
; for (y=0; y <= y_size; y++)
|
||||||
; for (x=0; x <= x_size; x++)
|
; for (x=0; x <= x_size; x++)
|
||||||
; if (shape[coord(x,y,scale)]==1)
|
; if (shape[coord(x,y,scale)]==1)
|
||||||
; set_pixel(x, y, process_number);
|
; set_pixel(x, y, process_number);
|
||||||
@ -1717,18 +1720,21 @@ end virtual
|
|||||||
|
|
||||||
push [edi + APPDATA.wnd_shape_scale] ; push scale first -> for loop
|
push [edi + APPDATA.wnd_shape_scale] ; push scale first -> for loop
|
||||||
|
|
||||||
; get WinMap start -> ebp
|
push ebx
|
||||||
push eax
|
push eax
|
||||||
mov eax, [_WinMapWidth] ; <<<<
|
mov ebp, eax
|
||||||
imul eax, ebx
|
shr ebp, 2
|
||||||
mov ebp, [esp]
|
|
||||||
shr ebp, 1
|
|
||||||
shr ebp, 1
|
|
||||||
add ebp, eax
|
|
||||||
add ebp, [_WinMapAddress]
|
add ebp, [_WinMapAddress]
|
||||||
|
mov eax, [_WinMapWidth]
|
||||||
|
shr ebx, 1
|
||||||
|
imul eax, ebx
|
||||||
|
add ebp, eax ; ebp = map origin
|
||||||
|
|
||||||
mov edi, [edi + APPDATA.wnd_shape]
|
mov edi, [edi + APPDATA.wnd_shape]
|
||||||
pop eax
|
pop eax
|
||||||
|
pop ebx
|
||||||
|
|
||||||
|
push ebp ; for loop - screen map origin
|
||||||
|
|
||||||
; eax = x_start
|
; eax = x_start
|
||||||
; ebx = y_start
|
; ebx = y_start
|
||||||
@ -1736,9 +1742,10 @@ end virtual
|
|||||||
; edx = y_size
|
; edx = y_size
|
||||||
; esi = process_number
|
; esi = process_number
|
||||||
; edi = &shape
|
; edi = &shape
|
||||||
|
; ebp = [ff_map]
|
||||||
; [scale]
|
; [scale]
|
||||||
push edx ecx ; for loop - x,y size
|
|
||||||
|
|
||||||
|
push edx ecx ; for loop - x,y size
|
||||||
mov ecx, esi
|
mov ecx, esi
|
||||||
shl ecx, 5
|
shl ecx, 5
|
||||||
mov edx, [window_data + ecx + WDATA.box.top]
|
mov edx, [window_data + ecx + WDATA.box.top]
|
||||||
@ -1769,40 +1776,41 @@ end virtual
|
|||||||
add eax, edx
|
add eax, edx
|
||||||
pop edx ebx
|
pop edx ebx
|
||||||
add eax, edi
|
add eax, edi
|
||||||
call .read_byte
|
call .read_byte ; al= shaped window pix-mask at a given point
|
||||||
test al,al
|
test al,al
|
||||||
jz @f
|
jz @f
|
||||||
mov eax, esi
|
mov eax, esi
|
||||||
mov [ebp], al
|
mov [ebp], al ; a tile belongs to the window if the 1st pixel's mask = 1
|
||||||
; -- end body --
|
; -- end body --
|
||||||
@@: inc ebp
|
@@:
|
||||||
inc edx
|
add edx, 4
|
||||||
|
inc ebp
|
||||||
cmp edx, [ff_xsz]
|
cmp edx, [ff_xsz]
|
||||||
jb .ff_new_x
|
jb .ff_new_x
|
||||||
|
|
||||||
sub ebp, [ff_xsz]
|
inc ebx
|
||||||
add ebp, [ff_x]
|
|
||||||
add ebp, [Screen_Max_X] ; screen.x
|
|
||||||
inc ebp
|
|
||||||
inc ebx
|
inc ebx
|
||||||
cmp ebx, [ff_ysz]
|
cmp ebx, [ff_ysz]
|
||||||
jb .ff_new_y
|
jnb @f
|
||||||
|
mov ebp, [ff_map]
|
||||||
add esp, 24
|
add ebp, [_WinMapWidth] ; even line: jump to next map row
|
||||||
|
mov [ff_map], ebp
|
||||||
|
jmp .ff_new_y
|
||||||
|
@@:
|
||||||
|
add esp, 7*4
|
||||||
.exit:
|
.exit:
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.read_byte:
|
.read_byte:
|
||||||
; eax - address
|
; eax - buffer address
|
||||||
; esi - slot
|
; esi - slot#
|
||||||
push eax ecx edx esi
|
push eax ecx edx esi
|
||||||
xchg eax, esi
|
xchg eax, esi
|
||||||
lea ecx, [esp + 12]
|
lea ecx, [esp + 12] ; buffer addr = stacked [eax] to return
|
||||||
mov edx, 1
|
mov edx, 1 ; buffer size
|
||||||
call read_process_memory
|
call read_process_memory ; (core/taskman.inc) returns #bytes read
|
||||||
pop esi edx ecx eax
|
pop esi edx ecx eax ; eax = PID
|
||||||
ret
|
ret
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
|
@ -161,7 +161,7 @@ drm:
|
|||||||
mov esi, edi
|
mov esi, edi
|
||||||
add edi, esi
|
add edi, esi
|
||||||
add edi, esi ; *3
|
add edi, esi ; *3
|
||||||
add edi,[MOUSE_PICTURE] ; we have our str address
|
add edi, mousepointer ;[MOUSE_PICTURE] ; we have our str address
|
||||||
mov esi, edi
|
mov esi, edi
|
||||||
add esi, 16*24*3
|
add esi, 16*24*3
|
||||||
push ecx
|
push ecx
|
||||||
|
@ -63,9 +63,6 @@ $Revision$
|
|||||||
|
|
||||||
USE_COM_IRQ equ 1 ; make irq 3 and irq 4 available for PCI devices
|
USE_COM_IRQ equ 1 ; make irq 3 and irq 4 available for PCI devices
|
||||||
|
|
||||||
; Enabling the next line will enable serial output console
|
|
||||||
;debug_com_base equ 0x3f8 ; 0x3f8 is com1, 0x2f8 is com2, 0x3e8 is com3, 0x2e8 is com4, no irq's are used
|
|
||||||
|
|
||||||
include "proc32.inc"
|
include "proc32.inc"
|
||||||
include "kglobals.inc"
|
include "kglobals.inc"
|
||||||
|
|
||||||
@ -344,8 +341,8 @@ high_code:
|
|||||||
mov [screen_workarea.bottom],eax
|
mov [screen_workarea.bottom],eax
|
||||||
movzx eax,word [BOOT_VAR+0x9008] ; screen mode
|
movzx eax,word [BOOT_VAR+0x9008] ; screen mode
|
||||||
mov [SCR_MODE],eax
|
mov [SCR_MODE],eax
|
||||||
mov eax,[BOOT_VAR+0x9014] ; Vesa 1.2 bnk sw add
|
; mov eax,[BOOT_VAR+0x9014] ; Vesa 1.2 bnk sw add == not used any more
|
||||||
mov [BANK_SWITCH],eax
|
; mov [BANK_SWITCH],eax
|
||||||
movzx eax, word[BOOT_VAR+0x9001] ; for other modes
|
movzx eax, word[BOOT_VAR+0x9001] ; for other modes
|
||||||
mov [BytesPerScanLine],ax
|
mov [BytesPerScanLine],ax
|
||||||
mov [_display.pitch], eax
|
mov [_display.pitch], eax
|
||||||
@ -375,8 +372,8 @@ high_code:
|
|||||||
; === EGA, VGA & Vesa 1.2 modes not supported ===
|
; === EGA, VGA & Vesa 1.2 modes not supported ===
|
||||||
setvesa20:
|
setvesa20:
|
||||||
v20ga32:
|
v20ga32:
|
||||||
mov [PUTPIXEL],dword put_pixel
|
; mov [PUTPIXEL],dword put_pixel
|
||||||
mov [GETPIXEL],dword get_pixel
|
; mov [GETPIXEL],dword get_pixel
|
||||||
|
|
||||||
; -------- Fast System Call init ----------
|
; -------- Fast System Call init ----------
|
||||||
.SEnP:
|
.SEnP:
|
||||||
@ -514,8 +511,8 @@ v20ga32:
|
|||||||
mov [BgrDrawMode],eax
|
mov [BgrDrawMode],eax
|
||||||
mov [BgrDataWidth],eax
|
mov [BgrDataWidth],eax
|
||||||
mov [BgrDataHeight],eax
|
mov [BgrDataHeight],eax
|
||||||
mov [mem_BACKGROUND], 4
|
; mov [mem_BACKGROUND], 4
|
||||||
mov [img_background], static_background_data
|
; mov [img_background], static_background_data
|
||||||
|
|
||||||
mov [SLOT_BASE + 256 + APPDATA.dir_table], sys_pgdir - OS_BASE
|
mov [SLOT_BASE + 256 + APPDATA.dir_table], sys_pgdir - OS_BASE
|
||||||
|
|
||||||
@ -603,17 +600,6 @@ end if
|
|||||||
mov esi, boot_memdetect
|
mov esi, boot_memdetect
|
||||||
call boot_log
|
call boot_log
|
||||||
|
|
||||||
; <<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
||||||
mov ebx, img_test_struct
|
|
||||||
mov ecx, 3*65536 + 4
|
|
||||||
mov edx, 32*65536 + 512
|
|
||||||
mov esi, 32
|
|
||||||
xor edi, edi
|
|
||||||
mov ebp, edi
|
|
||||||
call sys_putimage_palette.forced
|
|
||||||
|
|
||||||
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
||||||
|
|
||||||
movzx ecx, word [boot_y]
|
movzx ecx, word [boot_y]
|
||||||
or ecx, (10+29*6) shl 16 ; "Determining amount of memory"
|
or ecx, (10+29*6) shl 16 ; "Determining amount of memory"
|
||||||
sub ecx, 10
|
sub ecx, 10
|
||||||
@ -645,16 +631,9 @@ end if
|
|||||||
|
|
||||||
mov esi,boot_bgr
|
mov esi,boot_bgr
|
||||||
call boot_log
|
call boot_log
|
||||||
call init_background
|
call _init_background ;graph32.inc ?
|
||||||
call calculatebackground
|
call calculatebackground
|
||||||
|
|
||||||
; RESERVE SYSTEM IRQ'S JA PORT'S
|
|
||||||
|
|
||||||
; mov esi,boot_resirqports
|
|
||||||
; call boot_log
|
|
||||||
; call reserve_irqs_ports
|
|
||||||
|
|
||||||
|
|
||||||
; SET UP OS TASK
|
; SET UP OS TASK
|
||||||
|
|
||||||
mov esi,boot_setostask
|
mov esi,boot_setostask
|
||||||
@ -706,6 +685,138 @@ end if
|
|||||||
mov [SLOT_BASE+APPDATA.cursor],eax
|
mov [SLOT_BASE+APPDATA.cursor],eax
|
||||||
mov [SLOT_BASE+APPDATA.cursor+256],eax
|
mov [SLOT_BASE+APPDATA.cursor+256],eax
|
||||||
|
|
||||||
|
; <<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
|
|
||||||
|
; mov esi, img_test_struct_8
|
||||||
|
; mov edi, 151
|
||||||
|
|
||||||
|
; mov ebp, edi
|
||||||
|
; imul edi, [BytesPerScanLine]
|
||||||
|
; add edi, LFB_BASE + 32*4
|
||||||
|
; mov [img_lfb_origin], edi
|
||||||
|
; shr ebp, 1
|
||||||
|
; imul ebp, [_WinMapWidth]
|
||||||
|
; add ebp, 32/4
|
||||||
|
; add ebp, [_WinMapAddress]
|
||||||
|
; mov ecx, ebp
|
||||||
|
; add ecx, [_WinMapWidth]
|
||||||
|
; mov byte[ecx+1], 2
|
||||||
|
; mov ecx, 6
|
||||||
|
; mov [img_pix_y], ecx
|
||||||
|
; mov eax, 1
|
||||||
|
; mov [img_bytes_per_pix], eax
|
||||||
|
; mov ebx, 1
|
||||||
|
; bts ebx, 24
|
||||||
|
; mov eax, 8-1
|
||||||
|
; mov [img_pix_x], eax
|
||||||
|
; inc eax
|
||||||
|
; shr eax, 2
|
||||||
|
; mov [img_map_x], eax
|
||||||
|
; mov [img_draw_core_fn], draw_core_8bpp
|
||||||
|
; mov [img_draw_edge_fn], draw_edge_8bpp
|
||||||
|
; mov [img_buf_line_size], 9
|
||||||
|
; mov [img_palette], img_test_palette
|
||||||
|
|
||||||
|
; call draw_aligned_box
|
||||||
|
; add edi, 48
|
||||||
|
; mov edx, 8
|
||||||
|
; call draw_unaligned_edge
|
||||||
|
; mono
|
||||||
|
; bts ebx, 25
|
||||||
|
; add edi, [_WinMapWidth] ; = 1/16 of the screen width
|
||||||
|
; mov esi, img_test_struct_1
|
||||||
|
; mov [img_lfb_origin], edi
|
||||||
|
; mov ecx, 9
|
||||||
|
; mov [img_map_x], 4
|
||||||
|
; mov [img_bitoffset], 1
|
||||||
|
; mov [img_edgeoffset], 16
|
||||||
|
; mov [img_draw_core_fn], draw_core_1bpp
|
||||||
|
; mov [img_draw_edge_fn], draw_edge_1bpp
|
||||||
|
; mov [img_buf_line_size], 2
|
||||||
|
; mov [img_bytes_per_pix], 0
|
||||||
|
; call draw_aligned_box
|
||||||
|
; add edi, 48
|
||||||
|
; mov edx, 8
|
||||||
|
; call draw_unaligned_edge
|
||||||
|
; btr ebx, 25
|
||||||
|
; 32bpp
|
||||||
|
; add edi, [_WinMapWidth] ; = 1/16 of the screen width
|
||||||
|
; mov esi, img_test_struct_32
|
||||||
|
; mov [img_lfb_origin], edi
|
||||||
|
; mov ecx, 6
|
||||||
|
; mov [img_map_x], 2
|
||||||
|
; mov [img_draw_core_fn], draw_core_32bpp
|
||||||
|
; mov [img_draw_edge_fn], draw_edge_32bpp
|
||||||
|
; mov [img_buf_line_size], 32
|
||||||
|
; mov [img_bytes_per_pix], 4
|
||||||
|
; call draw_aligned_box
|
||||||
|
; add edi, 48
|
||||||
|
; mov edx, 8
|
||||||
|
; call draw_unaligned_edge
|
||||||
|
|
||||||
|
; 24bpp
|
||||||
|
; add edi, [_WinMapWidth] ; = 1/16 of the screen width
|
||||||
|
; mov esi, img_test_struct_24
|
||||||
|
; mov [img_lfb_origin], edi
|
||||||
|
; mov ecx, 7
|
||||||
|
; mov [img_map_x], 4
|
||||||
|
; mov [img_draw_core_fn], draw_core_24bpp
|
||||||
|
; mov [img_draw_edge_fn], draw_edge_24bpp
|
||||||
|
; mov [img_buf_line_size], 45
|
||||||
|
; mov [img_bytes_per_pix], 3
|
||||||
|
; call draw_aligned_box
|
||||||
|
; add edi, 80
|
||||||
|
; mov edx, 4
|
||||||
|
; call draw_unaligned_edge
|
||||||
|
|
||||||
|
; mov [TASK_BASE-twdw + WDATA.box.left], 0
|
||||||
|
; mov [TASK_BASE-twdw + WDATA.box.top], 0
|
||||||
|
; mov eax, [Screen_Max_X]
|
||||||
|
; mov [TASK_BASE-twdw + WDATA.box.width], eax
|
||||||
|
; mov eax, [Screen_Max_Y]
|
||||||
|
; mov [TASK_BASE-twdw + WDATA.box.height], eax
|
||||||
|
|
||||||
|
; mov ebx, img_test_struct_24
|
||||||
|
; mov ecx, 16*65536 + 7
|
||||||
|
; mov edx, 512*65536 + 400
|
||||||
|
|
||||||
|
; call _putimage
|
||||||
|
|
||||||
|
|
||||||
|
;-----------
|
||||||
|
; mov ebx, img_test_struct_32
|
||||||
|
; mov ecx, 6*65536 + 6
|
||||||
|
; mov edx, 32*65536 + 512
|
||||||
|
; mov esi, 32
|
||||||
|
; xor edi, edi
|
||||||
|
; mov ebp, edi
|
||||||
|
; call sys_putimage_palette.forced
|
||||||
|
|
||||||
|
; mov [img_palette], img_test_palette
|
||||||
|
; mov [img_bytes_per_pix], 0
|
||||||
|
; mov [img_buf_line_size], 0
|
||||||
|
; mov ebx, img_test_palette
|
||||||
|
; mov [img_draw_core_fn], draw_core_0bpp
|
||||||
|
; mov [img_draw_edge_fn], draw_edge_0bpp
|
||||||
|
; mov ecx, 20*65536 + 9
|
||||||
|
; mov edx, 513*65536 + 401
|
||||||
|
; call _putimage
|
||||||
|
|
||||||
|
; mov eax, 561
|
||||||
|
; mov ebx, 461
|
||||||
|
; mov ecx, 555
|
||||||
|
; mov edx, 333
|
||||||
|
; mov edi, 0xAA5533
|
||||||
|
; call _drawbar
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; jmp $
|
||||||
|
|
||||||
|
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; READ TSC / SECOND
|
; READ TSC / SECOND
|
||||||
|
|
||||||
mov esi,boot_tsc
|
mov esi,boot_tsc
|
||||||
@ -744,16 +855,17 @@ end if
|
|||||||
|
|
||||||
call set_variables
|
call set_variables
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; SET MOUSE
|
; SET MOUSE
|
||||||
|
|
||||||
;call detect_devices
|
;call detect_devices
|
||||||
stdcall load_driver, szPS2MDriver
|
stdcall load_driver, szPS2MDriver
|
||||||
; stdcall load_driver, szCOM_MDriver
|
|
||||||
|
|
||||||
mov esi,boot_setmouse
|
mov esi,boot_setmouse
|
||||||
call boot_log
|
call boot_log
|
||||||
call setmouse
|
; call setmouse
|
||||||
|
cli
|
||||||
|
|
||||||
; STACK AND FDC
|
; STACK AND FDC
|
||||||
|
|
||||||
@ -852,46 +964,6 @@ first_app_found:
|
|||||||
;// mike.dld ]
|
;// mike.dld ]
|
||||||
|
|
||||||
|
|
||||||
; Setup serial output console (if enabled)
|
|
||||||
|
|
||||||
if defined debug_com_base
|
|
||||||
|
|
||||||
; enable Divisor latch
|
|
||||||
|
|
||||||
mov dx, debug_com_base+3
|
|
||||||
mov al, 1 shl 7
|
|
||||||
out dx, al
|
|
||||||
|
|
||||||
; Set speed to 115200 baud (max speed)
|
|
||||||
|
|
||||||
mov dx, debug_com_base
|
|
||||||
mov al, 0x01
|
|
||||||
out dx, al
|
|
||||||
|
|
||||||
mov dx, debug_com_base+1
|
|
||||||
mov al, 0x00
|
|
||||||
out dx, al
|
|
||||||
|
|
||||||
; No parity, 8bits words, one stop bit, dlab bit back to 0
|
|
||||||
|
|
||||||
mov dx, debug_com_base+3
|
|
||||||
mov al, 3
|
|
||||||
out dx, al
|
|
||||||
|
|
||||||
; disable interrupts
|
|
||||||
|
|
||||||
mov dx, debug_com_base+1
|
|
||||||
mov al, 0
|
|
||||||
out dx, al
|
|
||||||
|
|
||||||
; clear + enable fifo (64 bits)
|
|
||||||
|
|
||||||
mov dx, debug_com_base+2
|
|
||||||
mov al, 0x7 + 1 shl 5
|
|
||||||
out dx, al
|
|
||||||
|
|
||||||
|
|
||||||
end if
|
|
||||||
|
|
||||||
; START MULTITASKING
|
; START MULTITASKING
|
||||||
|
|
||||||
@ -933,9 +1005,6 @@ boot_log:
|
|||||||
inc edi
|
inc edi
|
||||||
call dtext
|
call dtext
|
||||||
|
|
||||||
; mov [novesachecksum],1000
|
|
||||||
; call checkVga_N13
|
|
||||||
|
|
||||||
popad
|
popad
|
||||||
|
|
||||||
ret
|
ret
|
||||||
@ -951,11 +1020,9 @@ osloop:
|
|||||||
call window_check_events
|
call window_check_events
|
||||||
call mouse_check_events
|
call mouse_check_events
|
||||||
call checkmisc
|
call checkmisc
|
||||||
; call checkVga_N13
|
|
||||||
call stack_handler
|
call stack_handler
|
||||||
call checkidle
|
call checkidle
|
||||||
call check_fdd_motor_status
|
; call check_fdd_motor_status
|
||||||
; call check_ATAPI_device_event
|
|
||||||
jmp osloop
|
jmp osloop
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; ;
|
; ;
|
||||||
@ -1764,6 +1831,7 @@ sys_end:
|
|||||||
test eax, eax
|
test eax, eax
|
||||||
jz @F
|
jz @F
|
||||||
|
|
||||||
|
|
||||||
stdcall user_free, eax
|
stdcall user_free, eax
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
@ -2150,226 +2218,28 @@ bgrlockpid dd 0
|
|||||||
bgrlock db 0
|
bgrlock db 0
|
||||||
endg
|
endg
|
||||||
|
|
||||||
|
;=============================== SysFn 15 ================================
|
||||||
|
; no background service supported so far ...
|
||||||
|
;===========================================
|
||||||
|
|
||||||
sys_background:
|
sys_background:
|
||||||
|
|
||||||
cmp ebx,1 ; BACKGROUND SIZE
|
cmp ebx,6 ; subfns 1..5 do not return anything
|
||||||
jnz nosb1
|
jb .exit
|
||||||
test ecx,ecx
|
mov dword [esp+32], 0 ; subfns 6,7 return 0 as error
|
||||||
; cmp ecx,0
|
|
||||||
jz sbgrr
|
|
||||||
test edx,edx
|
|
||||||
; cmp edx,0
|
|
||||||
jz sbgrr
|
|
||||||
@@:
|
|
||||||
;;Maxis use atomic bts for mutexes 4.4.2009
|
|
||||||
bts dword [bgrlock], 0
|
|
||||||
jnc @f
|
|
||||||
call change_task
|
|
||||||
jmp @b
|
|
||||||
@@:
|
|
||||||
mov [BgrDataWidth],ecx
|
|
||||||
mov [BgrDataHeight],edx
|
|
||||||
; mov [bgrchanged],1
|
|
||||||
|
|
||||||
pushad
|
|
||||||
; return memory for old background
|
|
||||||
mov eax, [img_background]
|
|
||||||
cmp eax, static_background_data
|
|
||||||
jz @f
|
|
||||||
stdcall kernel_free, eax
|
|
||||||
@@:
|
|
||||||
; calculate RAW size
|
|
||||||
xor eax,eax
|
|
||||||
inc eax
|
|
||||||
cmp [BgrDataWidth],eax
|
|
||||||
jae @f
|
|
||||||
mov [BgrDataWidth],eax
|
|
||||||
@@:
|
|
||||||
cmp [BgrDataHeight],eax
|
|
||||||
jae @f
|
|
||||||
mov [BgrDataHeight],eax
|
|
||||||
@@:
|
|
||||||
mov eax,[BgrDataWidth]
|
|
||||||
imul eax,[BgrDataHeight]
|
|
||||||
lea eax,[eax*3]
|
|
||||||
mov [mem_BACKGROUND],eax
|
|
||||||
; get memory for new background
|
|
||||||
stdcall kernel_alloc, eax
|
|
||||||
test eax, eax
|
|
||||||
jz .memfailed
|
|
||||||
mov [img_background], eax
|
|
||||||
jmp .exit
|
|
||||||
.memfailed:
|
|
||||||
; revert to static monotone data
|
|
||||||
mov [img_background], static_background_data
|
|
||||||
xor eax, eax
|
|
||||||
inc eax
|
|
||||||
mov [BgrDataWidth], eax
|
|
||||||
mov [BgrDataHeight], eax
|
|
||||||
mov [mem_BACKGROUND], 4
|
|
||||||
.exit:
|
.exit:
|
||||||
popad
|
|
||||||
mov [bgrlock], 0
|
|
||||||
|
|
||||||
sbgrr:
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
nosb1:
|
;=============================== SysFn 39 ================================
|
||||||
|
; no background service supported so far ...
|
||||||
|
;===========================================
|
||||||
|
align 4
|
||||||
|
|
||||||
cmp ebx,2 ; SET PIXEL
|
sys_getbackground:
|
||||||
jnz nosb2
|
mov dword [esp+32], 0
|
||||||
|
|
||||||
mov eax, [img_background]
|
|
||||||
test ecx, ecx
|
|
||||||
jz @f
|
|
||||||
cmp eax, static_background_data
|
|
||||||
|
|
||||||
jz .ret
|
|
||||||
@@:
|
|
||||||
mov ebx, [mem_BACKGROUND]
|
|
||||||
add ebx, 4095
|
|
||||||
and ebx, -4096
|
|
||||||
sub ebx, 4
|
|
||||||
cmp ecx, ebx
|
|
||||||
ja .ret
|
|
||||||
|
|
||||||
mov ebx,[eax+ecx]
|
|
||||||
and ebx,0xFF000000 ;255*256*256*256
|
|
||||||
and edx,0x00FFFFFF ;255*256*256+255*256+255
|
|
||||||
add edx,ebx
|
|
||||||
mov [eax+ecx],edx
|
|
||||||
.ret:
|
|
||||||
ret
|
|
||||||
nosb2:
|
|
||||||
|
|
||||||
cmp ebx,3 ; DRAW BACKGROUND
|
|
||||||
jnz nosb3
|
|
||||||
draw_background_temp:
|
|
||||||
; cmp [bgrchanged],1 ;0
|
|
||||||
; je nosb31
|
|
||||||
;draw_background_temp:
|
|
||||||
; mov [bgrchanged],1 ;0
|
|
||||||
|
|
||||||
mov [background_defined], 1
|
|
||||||
mov byte[BACKGROUND_CHANGED], 1
|
|
||||||
call force_redraw_background
|
|
||||||
nosb31:
|
|
||||||
ret
|
|
||||||
nosb3:
|
|
||||||
|
|
||||||
cmp ebx,4 ; TILED / STRETCHED
|
|
||||||
jnz nosb4
|
|
||||||
cmp ecx,[BgrDrawMode]
|
|
||||||
je nosb41
|
|
||||||
mov [BgrDrawMode],ecx
|
|
||||||
; mov [bgrchanged],1
|
|
||||||
nosb41:
|
|
||||||
ret
|
|
||||||
nosb4:
|
|
||||||
|
|
||||||
cmp ebx,5 ; BLOCK MOVE TO BGR
|
|
||||||
jnz nosb5
|
|
||||||
cmp [img_background], static_background_data
|
|
||||||
jnz @f
|
|
||||||
test edx, edx
|
|
||||||
jnz .fin
|
|
||||||
cmp esi, 4
|
|
||||||
ja .fin
|
|
||||||
@@:
|
|
||||||
; bughere
|
|
||||||
mov eax, ecx
|
|
||||||
mov ebx, edx
|
|
||||||
add ebx, [img_background] ;IMG_BACKGROUND
|
|
||||||
mov ecx, esi
|
|
||||||
call memmove
|
|
||||||
.fin:
|
|
||||||
ret
|
|
||||||
nosb5:
|
|
||||||
|
|
||||||
cmp ebx, 6
|
|
||||||
jnz nosb6
|
|
||||||
;;Maxis use atomic bts for mutex 4.4.2009
|
|
||||||
@@:
|
|
||||||
bts dword [bgrlock], 0
|
|
||||||
jnc @f
|
|
||||||
call change_task
|
|
||||||
jmp @b
|
|
||||||
@@:
|
|
||||||
mov eax, [CURRENT_TASK]
|
|
||||||
mov [bgrlockpid], eax
|
|
||||||
cmp [img_background], static_background_data
|
|
||||||
jz .nomem
|
|
||||||
stdcall user_alloc, [mem_BACKGROUND]
|
|
||||||
mov [esp+32], eax
|
|
||||||
test eax, eax
|
|
||||||
jz .nomem
|
|
||||||
mov ebx, eax
|
|
||||||
shr ebx, 12
|
|
||||||
or dword [page_tabs+(ebx-1)*4], DONT_FREE_BLOCK
|
|
||||||
mov esi, [img_background]
|
|
||||||
shr esi, 12
|
|
||||||
mov ecx, [mem_BACKGROUND]
|
|
||||||
add ecx, 0xFFF
|
|
||||||
shr ecx, 12
|
|
||||||
.z:
|
|
||||||
mov eax, [page_tabs+ebx*4]
|
|
||||||
test al, 1
|
|
||||||
jz @f
|
|
||||||
call free_page
|
|
||||||
@@:
|
|
||||||
mov eax, [page_tabs+esi*4]
|
|
||||||
or al, PG_UW
|
|
||||||
mov [page_tabs+ebx*4], eax
|
|
||||||
mov eax, ebx
|
|
||||||
shl eax, 12
|
|
||||||
invlpg [eax]
|
|
||||||
inc ebx
|
|
||||||
inc esi
|
|
||||||
loop .z
|
|
||||||
ret
|
|
||||||
.nomem:
|
|
||||||
and [bgrlockpid], 0
|
|
||||||
mov [bgrlock], 0
|
|
||||||
nosb6:
|
|
||||||
cmp ebx, 7
|
|
||||||
jnz nosb7
|
|
||||||
cmp [bgrlock], 0
|
|
||||||
jz .err
|
|
||||||
mov eax, [CURRENT_TASK]
|
|
||||||
cmp [bgrlockpid], eax
|
|
||||||
jnz .err
|
|
||||||
mov eax, ecx
|
|
||||||
mov ebx, ecx
|
|
||||||
shr eax, 12
|
|
||||||
mov ecx, [page_tabs+(eax-1)*4]
|
|
||||||
test cl, USED_BLOCK+DONT_FREE_BLOCK
|
|
||||||
jz .err
|
|
||||||
jnp .err
|
|
||||||
push eax
|
|
||||||
shr ecx, 12
|
|
||||||
dec ecx
|
|
||||||
@@:
|
|
||||||
and dword [page_tabs+eax*4], 0
|
|
||||||
mov edx, eax
|
|
||||||
shl edx, 12
|
|
||||||
push eax
|
|
||||||
invlpg [edx]
|
|
||||||
pop eax
|
|
||||||
inc eax
|
|
||||||
loop @b
|
|
||||||
pop eax
|
|
||||||
and dword [page_tabs+(eax-1)*4], not DONT_FREE_BLOCK
|
|
||||||
stdcall user_free, ebx
|
|
||||||
mov [esp+32], eax
|
|
||||||
and [bgrlockpid], 0
|
|
||||||
mov [bgrlock], 0
|
|
||||||
ret
|
|
||||||
.err:
|
|
||||||
and dword [esp+32], 0
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
nosb7:
|
;===========================================
|
||||||
ret
|
|
||||||
|
|
||||||
force_redraw_background:
|
force_redraw_background:
|
||||||
and [draw_data+32 + RECT.left], 0
|
and [draw_data+32 + RECT.left], 0
|
||||||
@ -2382,53 +2252,8 @@ force_redraw_background:
|
|||||||
pop ebx eax
|
pop ebx eax
|
||||||
inc byte[REDRAW_BACKGROUND]
|
inc byte[REDRAW_BACKGROUND]
|
||||||
ret
|
ret
|
||||||
|
;===========================================
|
||||||
|
|
||||||
align 4
|
|
||||||
|
|
||||||
sys_getbackground:
|
|
||||||
; cmp eax,1 ; SIZE
|
|
||||||
dec ebx
|
|
||||||
jnz nogb1
|
|
||||||
mov eax,[BgrDataWidth]
|
|
||||||
shl eax,16
|
|
||||||
mov ax,[BgrDataHeight]
|
|
||||||
mov [esp+32],eax
|
|
||||||
ret
|
|
||||||
|
|
||||||
nogb1:
|
|
||||||
; cmp eax,2 ; PIXEL
|
|
||||||
dec ebx
|
|
||||||
jnz nogb2
|
|
||||||
|
|
||||||
mov eax, [img_background]
|
|
||||||
test ecx, ecx
|
|
||||||
jz @f
|
|
||||||
cmp eax, static_background_data
|
|
||||||
jz .ret
|
|
||||||
@@:
|
|
||||||
mov ebx, [mem_BACKGROUND]
|
|
||||||
add ebx, 4095
|
|
||||||
and ebx, -4096
|
|
||||||
sub ebx, 4
|
|
||||||
cmp ecx, ebx
|
|
||||||
ja .ret
|
|
||||||
|
|
||||||
mov eax,[ecx+eax]
|
|
||||||
|
|
||||||
and eax, 0xFFFFFF
|
|
||||||
mov [esp+32],eax
|
|
||||||
.ret:
|
|
||||||
ret
|
|
||||||
nogb2:
|
|
||||||
|
|
||||||
; cmp eax,4 ; TILED / STRETCHED
|
|
||||||
dec ebx
|
|
||||||
dec ebx
|
|
||||||
jnz nogb4
|
|
||||||
mov eax,[BgrDrawMode]
|
|
||||||
nogb4:
|
|
||||||
mov [esp+32],eax
|
|
||||||
ret
|
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
|
|
||||||
@ -2846,26 +2671,6 @@ ret
|
|||||||
;---------------------------------------------------------------------------------------------
|
;---------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
; check if pixel is allowed to be drawn
|
|
||||||
; -- not in use any more ?
|
|
||||||
|
|
||||||
;checkpixel:
|
|
||||||
; push eax ebx edx
|
|
||||||
; shr ebx, 1
|
|
||||||
; mov edx, [_WinMapWidth] ; <<<<
|
|
||||||
; imul edx, ebx
|
|
||||||
; shr eax, 2
|
|
||||||
; add eax, [_WinMapAddress]
|
|
||||||
; mov dl, [eax+edx]
|
|
||||||
;
|
|
||||||
; xor ecx, ecx
|
|
||||||
; mov eax, [CURRENT_TASK]
|
|
||||||
; cmp al, dl
|
|
||||||
; setne cl
|
|
||||||
;
|
|
||||||
; pop edx ebx eax
|
|
||||||
; ret
|
|
||||||
|
|
||||||
iglobal
|
iglobal
|
||||||
cpustring db 'CPU',0
|
cpustring db 'CPU',0
|
||||||
endg
|
endg
|
||||||
@ -3102,7 +2907,7 @@ redrawscreen:
|
|||||||
|
|
||||||
calculatebackground: ; background
|
calculatebackground: ; background
|
||||||
mov edi, [_WinMapAddress] ; set os to use all pixels
|
mov edi, [_WinMapAddress] ; set os to use all pixels
|
||||||
mov eax,0x01010101
|
mov eax, 0x01010101
|
||||||
mov ecx, [_WinMapSize]
|
mov ecx, [_WinMapSize]
|
||||||
shr ecx, 2
|
shr ecx, 2
|
||||||
rep stosd
|
rep stosd
|
||||||
@ -3291,18 +3096,10 @@ endg
|
|||||||
|
|
||||||
drawbackground:
|
drawbackground:
|
||||||
inc [mouse_pause]
|
inc [mouse_pause]
|
||||||
; cmp [BgrDrawMode],dword 1
|
call draw_background ; graph32.inc
|
||||||
; jne bgrstr
|
|
||||||
; call vesa20_drawbackground_tiled
|
|
||||||
call drawbackground
|
|
||||||
dec [mouse_pause]
|
dec [mouse_pause]
|
||||||
call [draw_pointer]
|
call [draw_pointer]
|
||||||
ret
|
ret
|
||||||
; bgrstr:
|
|
||||||
; call vesa20_drawbackground_stretch
|
|
||||||
; dec [mouse_pause]
|
|
||||||
; call [draw_pointer]
|
|
||||||
; ret
|
|
||||||
|
|
||||||
; ====================================================================
|
; ====================================================================
|
||||||
align 4
|
align 4
|
||||||
@ -3339,7 +3136,8 @@ sys_putimage_bpp: ; only called from sys_putimage_palette
|
|||||||
inc [mouse_pause]
|
inc [mouse_pause]
|
||||||
call _putimage
|
call _putimage
|
||||||
dec [mouse_pause]
|
dec [mouse_pause]
|
||||||
jmp [draw_pointer]
|
call [draw_pointer]
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
@ -3357,12 +3155,13 @@ sys_putimage_palette: ; sysFn 65
|
|||||||
add dx, word [eax+SLOT_BASE+APPDATA.wnd_clientbox.left]
|
add dx, word [eax+SLOT_BASE+APPDATA.wnd_clientbox.left]
|
||||||
rol edx, 16
|
rol edx, 16
|
||||||
.forced:
|
.forced:
|
||||||
|
push eax
|
||||||
|
push esi
|
||||||
mov [img_palette], edi
|
mov [img_palette], edi
|
||||||
mov eax, esi
|
mov eax, esi
|
||||||
cmp eax, 32 ;>32bpp (stupid call)
|
cmp eax, 32 ;>32bpp (stupid call)
|
||||||
ja .exit
|
ja .exit
|
||||||
shr al, 3 ; 0=1bpp, other lo-pix modes not supported
|
shr al, 3 ; 0=1bpp or solid color
|
||||||
push esi
|
|
||||||
mov [img_bytes_per_pix], eax
|
mov [img_bytes_per_pix], eax
|
||||||
mov esi, [eax*4 + img_core_proc_0]
|
mov esi, [eax*4 + img_core_proc_0]
|
||||||
mov [img_draw_core_fn], esi
|
mov [img_draw_core_fn], esi
|
||||||
@ -3370,29 +3169,34 @@ sys_putimage_palette: ; sysFn 65
|
|||||||
mov [img_draw_edge_fn], esi
|
mov [img_draw_edge_fn], esi
|
||||||
mov esi, ecx
|
mov esi, ecx
|
||||||
shr esi, 16 ; esi = SizeX
|
shr esi, 16 ; esi = SizeX
|
||||||
or al, al
|
|
||||||
jz .1bpp
|
|
||||||
imul esi, eax
|
imul esi, eax
|
||||||
jmp .done
|
or al, al
|
||||||
|
jnz .done
|
||||||
|
mov eax, [esp] ; bits per pixel
|
||||||
|
or al, al
|
||||||
|
jz .done
|
||||||
.1bpp:
|
.1bpp:
|
||||||
add esi, 7
|
add esi, 7
|
||||||
shr esi, 3 ; 8 pixels per byte
|
shr esi, 3 ; 8 pixels per byte
|
||||||
|
mov [img_draw_edge_fn], draw_edge_1bpp
|
||||||
|
mov [img_draw_core_fn], draw_core_1bpp
|
||||||
.done:
|
.done:
|
||||||
add esi, ebp ; + line offset
|
add esi, ebp ; + line offset
|
||||||
mov [img_buf_line_size], esi
|
mov [img_buf_line_size], esi
|
||||||
pop esi
|
pop esi
|
||||||
jmp _putimage ;<<< sys_putimage_bpp
|
pop eax
|
||||||
|
jmp sys_putimage_bpp
|
||||||
.exit:
|
.exit:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
img_core_proc_0 dd draw_core_1bpp
|
img_core_proc_0 dd draw_core_0bpp
|
||||||
img_core_proc_1 dd draw_core_8bpp
|
img_core_proc_1 dd draw_core_8bpp
|
||||||
img_core_proc_2 dd draw_core_16bpp
|
img_core_proc_2 dd draw_core_16bpp
|
||||||
img_core_proc_3 dd draw_core_24bpp
|
img_core_proc_3 dd draw_core_24bpp
|
||||||
img_core_proc_4 dd draw_core_32bpp
|
img_core_proc_4 dd draw_core_32bpp
|
||||||
|
|
||||||
img_edge_proc_0 dd draw_edge_1bpp
|
img_edge_proc_0 dd draw_edge_0bpp
|
||||||
img_edge_proc_1 dd draw_edge_8bpp
|
img_edge_proc_1 dd draw_edge_8bpp
|
||||||
img_edge_proc_2 dd draw_edge_16bpp
|
img_edge_proc_2 dd draw_edge_16bpp
|
||||||
img_edge_proc_3 dd draw_edge_24bpp
|
img_edge_proc_3 dd draw_edge_24bpp
|
||||||
@ -3414,7 +3218,7 @@ __sys_drawbar:
|
|||||||
.forced:
|
.forced:
|
||||||
inc [mouse_pause]
|
inc [mouse_pause]
|
||||||
; dbv20:
|
; dbv20:
|
||||||
call vesa20_drawbar
|
call _drawbar
|
||||||
dec [mouse_pause]
|
dec [mouse_pause]
|
||||||
jmp [draw_pointer]
|
jmp [draw_pointer]
|
||||||
|
|
||||||
@ -3517,26 +3321,24 @@ kb_cmd:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
setmouse: ; set mousepicture -pointer
|
;setmouse: ; set mousepicture -pointer
|
||||||
; ps2 mouse enable
|
; ps2 mouse enable
|
||||||
|
|
||||||
mov [MOUSE_PICTURE],dword mousepointer
|
; mov [MOUSE_PICTURE],dword mousepointer
|
||||||
|
; cli
|
||||||
|
; ret
|
||||||
|
|
||||||
cli
|
;if used _rdtsc
|
||||||
|
;_rdtsc:
|
||||||
ret
|
; bt [cpu_caps], CAPS_TSC
|
||||||
|
; jnc ret_rdtsc
|
||||||
if used _rdtsc
|
; rdtsc
|
||||||
_rdtsc:
|
; ret
|
||||||
bt [cpu_caps], CAPS_TSC
|
; ret_rdtsc:
|
||||||
jnc ret_rdtsc
|
; mov edx,0xffffffff
|
||||||
rdtsc
|
; mov eax,0xffffffff
|
||||||
ret
|
; ret
|
||||||
ret_rdtsc:
|
;end if
|
||||||
mov edx,0xffffffff
|
|
||||||
mov eax,0xffffffff
|
|
||||||
ret
|
|
||||||
end if
|
|
||||||
|
|
||||||
rerouteirqs:
|
rerouteirqs:
|
||||||
|
|
||||||
@ -3667,24 +3469,6 @@ sys_msg_board:
|
|||||||
cmp eax, 1
|
cmp eax, 1
|
||||||
jne .smbl1
|
jne .smbl1
|
||||||
|
|
||||||
if defined debug_com_base
|
|
||||||
|
|
||||||
push dx ax
|
|
||||||
|
|
||||||
@@: ; Wait for empty transmit register (yes, this slows down system..)
|
|
||||||
mov dx, debug_com_base+5
|
|
||||||
in al, dx
|
|
||||||
test al, 1 shl 5
|
|
||||||
jz @r
|
|
||||||
|
|
||||||
mov dx, debug_com_base ; Output the byte
|
|
||||||
mov al, bl
|
|
||||||
out dx, al
|
|
||||||
|
|
||||||
pop ax dx
|
|
||||||
|
|
||||||
end if
|
|
||||||
|
|
||||||
mov [msg_board_data+ecx],bl
|
mov [msg_board_data+ecx],bl
|
||||||
inc ecx
|
inc ecx
|
||||||
and ecx, 4095
|
and ecx, 4095
|
||||||
@ -3875,16 +3659,9 @@ syscall_setpixel: ; SetPixel
|
|||||||
mov eax, ebx
|
mov eax, ebx
|
||||||
mov ebx, ecx
|
mov ebx, ecx
|
||||||
mov ecx, edx
|
mov ecx, edx
|
||||||
mov edx, [TASK_BASE]
|
|
||||||
add eax, [edx-twdw+WDATA.box.left]
|
|
||||||
add ebx, [edx-twdw+WDATA.box.top]
|
|
||||||
mov edi, [current_slot]
|
|
||||||
add eax, [edi+APPDATA.wnd_clientbox.left]
|
|
||||||
add ebx, [edi+APPDATA.wnd_clientbox.top]
|
|
||||||
xor edi, edi ; no force
|
xor edi, edi ; no force
|
||||||
; mov edi, 1
|
; call [_display.disable_mouse]
|
||||||
call [_display.disable_mouse]
|
jmp __sys_putpixel
|
||||||
jmp [putpixel]
|
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
|
|
||||||
@ -3966,7 +3743,7 @@ syscall_getpixel: ; GetPixel
|
|||||||
div ecx
|
div ecx
|
||||||
mov ebx, edx
|
mov ebx, edx
|
||||||
xchg eax, ebx
|
xchg eax, ebx
|
||||||
call dword [GETPIXEL] ; eax - x, ebx - y
|
call get_pixel ; eax - x, ebx - y
|
||||||
mov [esp + 32], ecx
|
mov [esp + 32], ecx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -4028,7 +3805,7 @@ syscall_getarea:
|
|||||||
push eax ebx ecx
|
push eax ebx ecx
|
||||||
add eax,ecx
|
add eax,ecx
|
||||||
|
|
||||||
call dword [GETPIXEL] ; eax - x, ebx - y
|
call get_pixel ; eax - x, ebx - y
|
||||||
|
|
||||||
mov [ebp],cx
|
mov [ebp],cx
|
||||||
shr ecx,16
|
shr ecx,16
|
||||||
@ -4187,8 +3964,7 @@ set_screen:
|
|||||||
stdcall kernel_free, [_WinMapAddress]
|
stdcall kernel_free, [_WinMapAddress]
|
||||||
|
|
||||||
mov eax, [_display.width]
|
mov eax, [_display.width]
|
||||||
shr eax, 1
|
shr eax, 2
|
||||||
shr eax, 1
|
|
||||||
mov [_WinMapWidth], eax
|
mov [_WinMapWidth], eax
|
||||||
mov eax, [_display.height]
|
mov eax, [_display.height]
|
||||||
shr eax, 1
|
shr eax, 1
|
||||||
@ -4528,3 +4304,28 @@ __REV__ = __REV
|
|||||||
uglobals_size = $ - endofcode
|
uglobals_size = $ - endofcode
|
||||||
diff16 "Zero-filled blk",0,endofcode
|
diff16 "Zero-filled blk",0,endofcode
|
||||||
diff16 "End of kernel ",0,$
|
diff16 "End of kernel ",0,$
|
||||||
|
|
||||||
|
;Кургинян - математик, и основные свои выводы делает на основе теории катастроф (есть такая вполне себе прикладная область математики) с элементами вариационного и факторного анализа. В принципе, он мог бы изложить суть в 3-4 сухих формулах, но только понять их могли (и захотели) бы человек 200-300...
|
||||||
|
|
||||||
|
;Вот и приходится ему излагать то же самое, но гораздо длиннее и доходчивее. Лично я не поленился и прочитал цикл "Кризис и другие" в архиве "Завтра" за 2009 год.
|
||||||
|
|
||||||
|
|
||||||
|
;Вот очень краткая выжимка его основных идей (с моей колокольни, конечно):
|
||||||
|
|
||||||
|
;1) Планета перенаселена, ресурсов на всех не хватит, период либеральненкой глобализации должен смениться эрой жесткого рационирования при тотальном контроле всего.
|
||||||
|
|
||||||
|
;2) У грядущего тоталитарного общества должна быть господствующая идеология, мобилизующая людей в суровой борьбе. Какой ей быть? для этого надо ответить на два основных вопроса: а) можно ли сделать человека лучше, сильнее, умнее? и б) можно ли сделать общество лучше, справедливее, свободнее?
|
||||||
|
|
||||||
|
;3) существует 4 возможных ответа на эти 2 вопроса: (а+б+) исторический модерн, он же коммунизм; (а+б-) антиисторический модерн, или фашизм; (а-б+) религиозный фундаментализм, или Контрмодерн; и наконец (а-б-) циничный антигуманизм, он же Постмодерн.
|
||||||
|
|
||||||
|
;4) крушение коммунистического проекта в XX веке было тщательно спланированной катастрофой с целью поворота человечества с модернистского пути развития на постмодернистский путь распада. Кургинян здесь имеет в виду катастрофу в математическом смысле, т.е. не какое-то печальное событие, а процесс, приводящий к такому событию. Я не хочу пересказывать здесь все положения теории катастроф - важно только понимать, что такой процесс вовсе не обязательно должен приводить к фатальному исходу - выход из катастрофы всегда можно найти, вплоть до самого последнего момента!
|
||||||
|
|
||||||
|
;5) катиться по этому катастрофическому пути легко, но найти выход из катастрофы с каждым шагом все сложнее. Чтобы избежать фатального конца, одной энергии мало - требуется изрядная сила воли.
|
||||||
|
|
||||||
|
;6) здесь Кургинян подключает другой математический аппарат - теорию игр. И показывает, как шулера - магистры сложной коалиционно-антагонистической игры умеют целенаправленно и эффективно лишать противников воли и смыслов для поиска выхода из катастрофы.
|
||||||
|
|
||||||
|
;7) конечно, человеческое общество - сложнейшая система с непредсказуемым откликом на актиные действия каждого из игроков. Даже опытнейший шулер может здесь сделать неверные ходы. Но в распоряжении мастеров игры имеется еще один мощный аппарат - факторный анализ, позволяющий эффективно корректировать промахи и лучше предсказывть поведение сложных систем.
|
||||||
|
|
||||||
|
;8) и тем не менее, выход есть! Для начала, надо реально осознать свою позицию в игре и навязать свою, активную игру (каждый новый активный игрок усложняет партнерам анализ игры). Это сложно (проще быть болваном), и это требует Воли и воссоздания Смыслов.
|
||||||
|
|
||||||
|
;9) даже самая активная игра будет простым барахтаньем, если не ставится конечная цель. Такая цель есть. Точнее - была: проект (а+б+). Если ее восстановить, мы не просто вернемся к активной игре - мы можем сформировать мощную коалицию антипостмодернистов.
|
||||||
|
@ -67,9 +67,9 @@
|
|||||||
;
|
;
|
||||||
; 6F00 -> 6FFF free (256)
|
; 6F00 -> 6FFF free (256)
|
||||||
;
|
;
|
||||||
; 7000 -> 7FFF used CD driver
|
; 7000 -> 7FFF unused? CD driver (4k)
|
||||||
;
|
;
|
||||||
; 8000 -> A3FF used FLOPPY driver
|
; 8000 -> A3FF used? FLOPPY driver (4k)
|
||||||
;
|
;
|
||||||
; A400 -> B0FF free (3k3), unused ACTIVE_PROC_STACK
|
; A400 -> B0FF free (3k3), unused ACTIVE_PROC_STACK
|
||||||
|
|
||||||
@ -143,14 +143,14 @@
|
|||||||
;
|
;
|
||||||
; 0x80010000 -> 6CBFF kernel, 32-bit run-time code (up to 371 Kb)
|
; 0x80010000 -> 6CBFF kernel, 32-bit run-time code (up to 371 Kb)
|
||||||
; in the current version:
|
; in the current version:
|
||||||
; -> 00B37 16-bit code end
|
; -> 00B3C 16-bit code end
|
||||||
; -> 00C40 16-bit data end
|
; -> 00C40 16-bit data end
|
||||||
; -> 10C40 32-bit code start
|
; -> 10C40 32-bit code start
|
||||||
; -> 2D582 32-bit code end
|
; -> 2D07E 32-bit code end
|
||||||
; -> 30918..end_of_kernel zero-filled zone after preinit_mem
|
; -> 30418..end_of_kernel zero-filled zone after preinit_mem
|
||||||
; -> 3421B uninitialized globals start
|
; -> 33D63 uninitialized globals start
|
||||||
; -> 3C40A end_of_kernel
|
; -> 3BF52 end_of_kernel
|
||||||
; -> 3D000 not used (194k)
|
; -> 3C000 not used (>200k)
|
||||||
; 0x80050000 -> 090000 zero-filled zone after preinit_mem
|
; 0x80050000 -> 090000 zero-filled zone after preinit_mem
|
||||||
; 0x8006CC00 -> 6DBFF stack at boot time (4Kb)
|
; 0x8006CC00 -> 6DBFF stack at boot time (4Kb)
|
||||||
;
|
;
|
||||||
|
@ -51,20 +51,25 @@ draw_aligned_box:
|
|||||||
mov eax, [img_map_x]
|
mov eax, [img_map_x]
|
||||||
xor ecx, ecx
|
xor ecx, ecx
|
||||||
cmp bl, byte[ebp] ; check the left tile first
|
cmp bl, byte[ebp] ; check the left tile first
|
||||||
jz .new_tile
|
je .new_tile
|
||||||
bts ebx, 26 ; ebx[26] = 1 if edi/esi already pushed
|
bts ebx, 26 ; ebx[26] = 1 if edi/esi pushed
|
||||||
jc .seek_visible
|
|
||||||
push edi
|
push edi
|
||||||
push esi
|
push esi
|
||||||
|
push [img_bitoffset]
|
||||||
jmp .seek_visible
|
jmp .seek_visible
|
||||||
.new_tile:
|
.new_tile:
|
||||||
inc ecx ; visible - scan the open space
|
inc ecx ; visible - scan the open space
|
||||||
cmp ecx, eax
|
cmp ecx, eax
|
||||||
jz .end_of_line
|
jz .end_of_line
|
||||||
cmp bl, byte[ebp+ecx] ; overlapped? draw the visible segment if so
|
cmp bl, byte[ebp+ecx]
|
||||||
je .new_tile
|
je .new_tile
|
||||||
|
; overlapped? draw the last visible segment if so
|
||||||
call [img_draw_core_fn] ; bpp-specific helper (see below)
|
bts ebx, 26 ; check if edi/esi already pushed
|
||||||
|
jc @f
|
||||||
|
push edi
|
||||||
|
push esi
|
||||||
|
push [img_bitoffset]
|
||||||
|
@@: call [img_draw_core_fn] ; bpp-specific helper (see below)
|
||||||
|
|
||||||
.seek_visible:
|
.seek_visible:
|
||||||
inc ecx
|
inc ecx
|
||||||
@ -76,8 +81,17 @@ draw_aligned_box:
|
|||||||
sub eax, ecx
|
sub eax, ecx
|
||||||
shl ecx, 4
|
shl ecx, 4
|
||||||
add edi, ecx ; shift the left edge
|
add edi, ecx ; shift the left edge
|
||||||
|
bt ebx, 25 ; 1bpp?
|
||||||
|
jc @f
|
||||||
shr ecx, 2
|
shr ecx, 2
|
||||||
imul ecx, [img_bytes_per_pix]
|
imul ecx, [img_bytes_per_pix]
|
||||||
|
jmp .new_visible
|
||||||
|
@@: shr ecx, 8 ; 2 tiles = 1 byte
|
||||||
|
jnc .new_visible
|
||||||
|
rol [img_bitoffset], 4
|
||||||
|
jnc .new_visible
|
||||||
|
inc ecx
|
||||||
|
.new_visible:
|
||||||
add esi, ecx
|
add esi, ecx
|
||||||
xor ecx, ecx
|
xor ecx, ecx
|
||||||
jmp .new_tile
|
jmp .new_tile
|
||||||
@ -88,6 +102,7 @@ draw_aligned_box:
|
|||||||
.next_line:
|
.next_line:
|
||||||
bt ebx, 26
|
bt ebx, 26
|
||||||
jnc @f
|
jnc @f
|
||||||
|
pop [img_bitoffset]
|
||||||
pop esi
|
pop esi
|
||||||
pop edi
|
pop edi
|
||||||
@@: inc edx
|
@@: inc edx
|
||||||
@ -117,7 +132,7 @@ draw_unaligned_edge:
|
|||||||
pushad
|
pushad
|
||||||
mov eax, [img_buf_line_size]
|
mov eax, [img_buf_line_size]
|
||||||
mov bh, dl ; store the 1st tile offset
|
mov bh, dl ; store the 1st tile offset
|
||||||
bt ebx, 24 ; check if the 1st line odd
|
btr ebx, 24 ; check if the 1st line odd
|
||||||
jnc .new_tile
|
jnc .new_tile
|
||||||
cmp bl, byte[ebp]
|
cmp bl, byte[ebp]
|
||||||
jne @f
|
jne @f
|
||||||
@ -128,7 +143,6 @@ draw_unaligned_edge:
|
|||||||
add edi, [BytesPerScanLine]
|
add edi, [BytesPerScanLine]
|
||||||
add ebp, [_WinMapWidth]
|
add ebp, [_WinMapWidth]
|
||||||
add esi, eax
|
add esi, eax
|
||||||
btr ebx, 24
|
|
||||||
.new_tile:
|
.new_tile:
|
||||||
cmp bl, byte[ebp]
|
cmp bl, byte[ebp]
|
||||||
jne .skip_tile
|
jne .skip_tile
|
||||||
@ -165,6 +179,18 @@ draw_unaligned_edge:
|
|||||||
; edi -> left point of the screen edge
|
; edi -> left point of the screen edge
|
||||||
; bh = edx = tile offset (0, 4, 8 or 12 bytes)
|
; bh = edx = tile offset (0, 4, 8 or 12 bytes)
|
||||||
|
|
||||||
|
align 4
|
||||||
|
draw_edge_0bpp:
|
||||||
|
push eax
|
||||||
|
mov eax, [esi]
|
||||||
|
.putpix:
|
||||||
|
mov [edi+edx], eax
|
||||||
|
sub dl, 4
|
||||||
|
jae .putpix
|
||||||
|
.exit:
|
||||||
|
movzx edx, bh
|
||||||
|
pop eax
|
||||||
|
ret
|
||||||
align 4
|
align 4
|
||||||
draw_edge_32bpp:
|
draw_edge_32bpp:
|
||||||
push eax
|
push eax
|
||||||
@ -174,7 +200,7 @@ draw_edge_32bpp:
|
|||||||
sub dl, 4
|
sub dl, 4
|
||||||
jae .putpix
|
jae .putpix
|
||||||
.exit:
|
.exit:
|
||||||
mov dl, bh
|
movzx edx, bh
|
||||||
pop eax
|
pop eax
|
||||||
ret
|
ret
|
||||||
align 4
|
align 4
|
||||||
@ -185,8 +211,8 @@ draw_edge_24bpp:
|
|||||||
mov eax, [esi]
|
mov eax, [esi]
|
||||||
and eax, 0x00FFFFFF
|
and eax, 0x00FFFFFF
|
||||||
mov [edi+edx], eax
|
mov [edi+edx], eax
|
||||||
test dl, bh
|
cmp dl, bh
|
||||||
jz .exit
|
je .exit
|
||||||
add dl, 4
|
add dl, 4
|
||||||
add esi, 3
|
add esi, 3
|
||||||
jmp .putpix
|
jmp .putpix
|
||||||
@ -202,8 +228,8 @@ draw_edge_8bpp:
|
|||||||
movzx eax, byte[esi]
|
movzx eax, byte[esi]
|
||||||
mov eax, [ebp+eax*4]
|
mov eax, [ebp+eax*4]
|
||||||
mov [edi+edx], eax
|
mov [edi+edx], eax
|
||||||
test dl, bh
|
cmp dl, bh
|
||||||
jz .exit
|
je .exit
|
||||||
add dl, 4
|
add dl, 4
|
||||||
inc esi
|
inc esi
|
||||||
jmp .putpix
|
jmp .putpix
|
||||||
@ -212,28 +238,29 @@ draw_edge_8bpp:
|
|||||||
ret
|
ret
|
||||||
align 4
|
align 4
|
||||||
draw_edge_1bpp:
|
draw_edge_1bpp:
|
||||||
push eax ecx ebx ebp
|
pushad
|
||||||
|
movzx edx, bh
|
||||||
|
add edx, edi
|
||||||
mov ebp, [img_palette]
|
mov ebp, [img_palette]
|
||||||
mov ebx, [ebp+4] ; forecolor
|
mov ebx, [ebp+4] ; forecolor
|
||||||
mov ebp, [ebp] ; backcolor
|
mov ebp, [ebp] ; backcolor
|
||||||
mov ecx, [img_edgeoffset] ; cl = 1 << left_edge_pix_num
|
mov ecx, [img_edgeoffset] ; cl = 1 << left_edge_pix_num
|
||||||
mov ebp, [esi]
|
mov eax, [esi]
|
||||||
xor dl, dl
|
|
||||||
.testbit:
|
.testbit:
|
||||||
test ebp, ecx
|
test eax, ecx
|
||||||
jnz @f
|
jnz @f
|
||||||
mov eax, ebp
|
mov eax, ebp
|
||||||
jmp .putpix
|
jmp .putpix
|
||||||
@@: mov eax, ebx
|
@@: mov eax, ebx
|
||||||
.putpix:
|
.putpix:
|
||||||
mov [edi+edx], eax
|
mov [edi], eax
|
||||||
test dl, bh
|
cmp edi, edx
|
||||||
jz .exit
|
je .exit
|
||||||
add dl, 4
|
add edi, 4
|
||||||
shl ecx, 1
|
rol ecx, 1
|
||||||
jmp .testbit
|
jmp .testbit
|
||||||
.exit:
|
.exit:
|
||||||
pop ebp ebx ecx eax
|
popad
|
||||||
ret
|
ret
|
||||||
|
|
||||||
draw_edge_16bpp:
|
draw_edge_16bpp:
|
||||||
@ -242,35 +269,46 @@ draw_core_16bpp:
|
|||||||
|
|
||||||
;-------------
|
;-------------
|
||||||
; aligned core helpers
|
; aligned core helpers
|
||||||
; esi -> left point address (image)
|
; esi -> left point address (buffer)
|
||||||
; edi -> left point address (screen)
|
; edi -> left point address (screen)
|
||||||
; cx = number of tiles to draw
|
; ecx = number of tiles to draw
|
||||||
|
align 4
|
||||||
|
draw_core_0bpp:
|
||||||
|
push eax ecx edi
|
||||||
|
pushfd
|
||||||
|
; cli
|
||||||
|
cld
|
||||||
|
mov eax, [esi]
|
||||||
|
shl ecx, 2
|
||||||
|
rep stosd
|
||||||
|
popfd
|
||||||
|
pop edi ecx eax
|
||||||
|
ret
|
||||||
align 4
|
align 4
|
||||||
draw_core_32bpp:
|
draw_core_32bpp:
|
||||||
push ecx
|
push ecx esi edi
|
||||||
shl ecx, 1
|
pushfd
|
||||||
dec ecx
|
; cli
|
||||||
.putpix:
|
cld
|
||||||
fld qword[esi+ecx*8] ; 2 qwords = 1 tile
|
shl ecx, 2
|
||||||
fstp qword[edi+ecx*8]
|
rep movsd
|
||||||
dec cx
|
popfd
|
||||||
jnb .putpix
|
pop edi esi ecx
|
||||||
pop ecx
|
|
||||||
ret
|
ret
|
||||||
align 4
|
align 4
|
||||||
draw_core_24bpp:
|
draw_core_24bpp:
|
||||||
push eax ecx
|
push eax ecx edx
|
||||||
shl ecx, 2
|
shl ecx, 2 ; ecx = numpixels
|
||||||
dec ecx
|
dec ecx
|
||||||
lea eax, [ecx*2+ecx]
|
lea edx, [ecx*2+ecx] ; edx = buffer byte offset
|
||||||
.putpix:
|
.putpix:
|
||||||
mov eax, [esi+eax]
|
mov eax, [esi+edx]
|
||||||
and eax, 0x00FFFFFF
|
and eax, 0x00FFFFFF
|
||||||
mov [edi+ecx*4], eax
|
mov [edi+ecx*4], eax
|
||||||
sub dx, 3
|
dec ecx
|
||||||
dec cx
|
sub edx, 3
|
||||||
jnb .putpix
|
jnb .putpix
|
||||||
pop ecx eax
|
pop edx ecx eax
|
||||||
ret
|
ret
|
||||||
align 4
|
align 4
|
||||||
draw_core_8bpp:
|
draw_core_8bpp:
|
||||||
@ -289,7 +327,7 @@ draw_core_8bpp:
|
|||||||
jnz .putone
|
jnz .putone
|
||||||
add esi, edx ;-)
|
add esi, edx ;-)
|
||||||
add edi, 16
|
add edi, 16
|
||||||
dec cx
|
dec ecx
|
||||||
jnz .putpix
|
jnz .putpix
|
||||||
.exit:
|
.exit:
|
||||||
popad
|
popad
|
||||||
@ -302,8 +340,6 @@ draw_core_1bpp:
|
|||||||
mov ebp, [ebp] ; background color
|
mov ebp, [ebp] ; background color
|
||||||
mov ebx, [img_bitoffset]
|
mov ebx, [img_bitoffset]
|
||||||
shl ecx, 2 ; 1 tyle = 4 pix
|
shl ecx, 2 ; 1 tyle = 4 pix
|
||||||
dec ecx
|
|
||||||
jb .exit
|
|
||||||
.newblock:
|
.newblock:
|
||||||
mov eax, [esi]
|
mov eax, [esi]
|
||||||
.putpix:
|
.putpix:
|
||||||
@ -314,8 +350,8 @@ draw_core_1bpp:
|
|||||||
.bkcolor:
|
.bkcolor:
|
||||||
mov [edi], ebp
|
mov [edi], ebp
|
||||||
.nextpix:
|
.nextpix:
|
||||||
dec cx
|
dec ecx
|
||||||
jb .exit
|
jz .exit
|
||||||
rol ebx, 1
|
rol ebx, 1
|
||||||
jc .nextblock
|
jc .nextblock
|
||||||
add edi, 4
|
add edi, 4
|
||||||
@ -339,6 +375,10 @@ align 4
|
|||||||
; ebx -> Buffer origin
|
; ebx -> Buffer origin
|
||||||
; ecx = packed size [x|y]
|
; ecx = packed size [x|y]
|
||||||
; edx = packed coordinates [x|y]
|
; edx = packed coordinates [x|y]
|
||||||
|
; static variables required:
|
||||||
|
; [img_draw_core_fn], [img_draw_edge_fn]
|
||||||
|
; [img_bytes_per_pix], [img_buf_line_size]
|
||||||
|
; [img_palette] (1bpp and 8bpp only)
|
||||||
|
|
||||||
_putimage:
|
_putimage:
|
||||||
; call [_display.disable_mouse]
|
; call [_display.disable_mouse]
|
||||||
@ -356,14 +396,15 @@ _putimage:
|
|||||||
and edx, 0xFFFF ; Ytop
|
and edx, 0xFFFF ; Ytop
|
||||||
shr eax, 16 ; Xleft
|
shr eax, 16 ; Xleft
|
||||||
.calculate_abs_coords:
|
.calculate_abs_coords:
|
||||||
mov ebx, [TASK_BASE-twdw + WDATA.box.left]
|
mov edi, [TASK_BASE]
|
||||||
mov ecx, [TASK_BASE-twdw + WDATA.box.top]
|
mov ebx, [edi-twdw + WDATA.box.left]
|
||||||
|
mov ecx, [edi-twdw + WDATA.box.top]
|
||||||
add ebx, eax
|
add ebx, eax
|
||||||
add ecx, edx
|
add ecx, edx
|
||||||
mov [img_screen_x], ebx ; abs Xleft
|
mov [img_screen_x], ebx ; abs Xleft
|
||||||
; mov [img_screen_y], ecx ; ecx = abs Ytop ; hold it !
|
; mov [img_screen_y], ecx ; ecx = abs Ytop ; hold it !
|
||||||
.check_x_size:
|
.check_x_size:
|
||||||
mov ebx, [TASK_BASE-twdw + WDATA.box.width]
|
mov ebx, [edi-twdw + WDATA.box.width]
|
||||||
inc ebx ; ebx = window Xsize
|
inc ebx ; ebx = window Xsize
|
||||||
sub ebx, eax ; eax = rel Xleft
|
sub ebx, eax ; eax = rel Xleft
|
||||||
jbe .finish ; image is out of the window
|
jbe .finish ; image is out of the window
|
||||||
@ -374,7 +415,7 @@ _putimage:
|
|||||||
@@: dec eax
|
@@: dec eax
|
||||||
mov [img_pix_x], eax
|
mov [img_pix_x], eax
|
||||||
.check_y_size:
|
.check_y_size:
|
||||||
mov ebx, [TASK_BASE-twdw + WDATA.box.height]
|
mov ebx, [edi-twdw + WDATA.box.height]
|
||||||
inc ebx ; ebx = real window y-size
|
inc ebx ; ebx = real window y-size
|
||||||
sub ebx, edx ; edx = rel Ytop
|
sub ebx, edx ; edx = rel Ytop
|
||||||
jbe .finish ; image isn't visible
|
jbe .finish ; image isn't visible
|
||||||
@ -396,6 +437,9 @@ _putimage:
|
|||||||
mov bl, byte [img_bytes_per_pix]
|
mov bl, byte [img_bytes_per_pix]
|
||||||
or bl, bl
|
or bl, bl
|
||||||
jnz @f
|
jnz @f
|
||||||
|
mov ecx, [img_buf_line_size]
|
||||||
|
or cl, cl
|
||||||
|
je @f
|
||||||
bts ebx, 25
|
bts ebx, 25
|
||||||
@@: mov bl, byte [CURRENT_TASK] ; get process number
|
@@: mov bl, byte [CURRENT_TASK] ; get process number
|
||||||
mov ebp, ecx ; ecx = absY
|
mov ebp, ecx ; ecx = absY
|
||||||
@ -407,9 +451,10 @@ _putimage:
|
|||||||
mov ecx, eax ; eax = absX
|
mov ecx, eax ; eax = absX
|
||||||
shr ecx, 2
|
shr ecx, 2
|
||||||
add eax, [img_pix_x]
|
add eax, [img_pix_x]
|
||||||
|
inc eax
|
||||||
shr eax, 2
|
shr eax, 2
|
||||||
add eax, ebp
|
add eax, ebp
|
||||||
mov [img_map_right], eax ; right edge tile
|
; mov [img_map_right], eax ; right edge tile
|
||||||
add ebp, ecx ; left edge Map origin
|
add ebp, ecx ; left edge Map origin
|
||||||
mov ecx, [img_pix_y]
|
mov ecx, [img_pix_y]
|
||||||
sub eax, ebp
|
sub eax, ebp
|
||||||
@ -422,8 +467,8 @@ _putimage:
|
|||||||
; ebp -> corner tile position
|
; ebp -> corner tile position
|
||||||
; ecx = [img_pix_y] = image height
|
; ecx = [img_pix_y] = image height
|
||||||
; bl = task #
|
; bl = task #
|
||||||
; ebx[24] = 1 if the core Y is odd
|
; ebx[24] = 1 if Ytop is odd
|
||||||
; ebx[25] = 1bpp image
|
; ebx[25] = 1 if 1bpp image
|
||||||
|
|
||||||
.start:
|
.start:
|
||||||
bt ebx, 25
|
bt ebx, 25
|
||||||
@ -434,10 +479,10 @@ _putimage:
|
|||||||
mov [img_edgeoffset], eax
|
mov [img_edgeoffset], eax
|
||||||
@@:
|
@@:
|
||||||
mov edx, edi
|
mov edx, edi
|
||||||
and edx, 0x0C
|
mov dh, 0x0C
|
||||||
|
and dl, dh
|
||||||
jz .go_right ; left edge already aligned
|
jz .go_right ; left edge already aligned
|
||||||
.left_edge:
|
.left_edge:
|
||||||
mov dh, 0x0C
|
|
||||||
sub dh, dl
|
sub dh, dl
|
||||||
movzx edx, dh
|
movzx edx, dh
|
||||||
call draw_unaligned_edge
|
call draw_unaligned_edge
|
||||||
@ -481,26 +526,26 @@ _putimage:
|
|||||||
mov eax, [img_pix_x]
|
mov eax, [img_pix_x]
|
||||||
shl eax, 2 ; 1 pix = 4 bytes
|
shl eax, 2 ; 1 pix = 4 bytes
|
||||||
add eax, edi ; rightEdge last pix (LFB addr)
|
add eax, edi ; rightEdge last pix (LFB addr)
|
||||||
|
shl edx, 4
|
||||||
|
add edi, edx ; rightEdge Screen origin
|
||||||
movzx edx, al
|
movzx edx, al
|
||||||
|
mov eax, [img_map_x]
|
||||||
and dl, 0x0C
|
and dl, 0x0C
|
||||||
jz .core_block ; rightEdge is already tile-aligned
|
cmp dl, 0x0C
|
||||||
and al, 0xF0
|
je .core_block ; rightEdge is already tile-aligned
|
||||||
mov edi, eax ; rightEdge Screen origin
|
|
||||||
.right_edge:
|
.right_edge:
|
||||||
call draw_unaligned_edge
|
call draw_unaligned_edge
|
||||||
dec [img_map_x]
|
|
||||||
.core_block:
|
.core_block:
|
||||||
pop ebp
|
|
||||||
mov eax, [img_map_x]
|
|
||||||
or eax, eax ; empty central core?
|
or eax, eax ; empty central core?
|
||||||
jz .finish
|
jz .finish
|
||||||
|
mov ebp, [esp]
|
||||||
mov edi, [img_lfb_origin]
|
mov edi, [img_lfb_origin]
|
||||||
mov esi, [img_buf_origin]
|
mov esi, [img_buf_origin]
|
||||||
|
|
||||||
call draw_aligned_box
|
call draw_aligned_box
|
||||||
|
|
||||||
.finish:
|
.finish:
|
||||||
add esp, putimg.stack_data
|
add esp, (putimg.stack_data + 4)
|
||||||
; call [_display.enable_mouse]
|
; call [_display.enable_mouse]
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
@ -509,19 +554,81 @@ _putimage:
|
|||||||
mov edx, [img_pix_x]
|
mov edx, [img_pix_x]
|
||||||
shl edx, 2 ; edx = rightmost tile offset (0, 4, 8, or 12 bytes)
|
shl edx, 2 ; edx = rightmost tile offset (0, 4, 8, or 12 bytes)
|
||||||
call draw_unaligned_edge
|
call draw_unaligned_edge
|
||||||
jmp .finish
|
add esp, putimg.stack_data
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
align 64
|
;align 64
|
||||||
img_test_struct:
|
;img_test_struct_32: ; 8 x 10
|
||||||
dd 0x00112233, 0x00223344, 0x00334455, 0x00445566
|
; dd 0x112233, 0x223344, 0x334455, 0x445566, 0x556677, 0x667788, 0x778899, 0x887766
|
||||||
dd 0x00223344, 0x00334455, 0x00445566, 0x00334455
|
; dd 0x223344, 0x334455, 0x445566, 0x556677, 0x667788, 0x777799, 0x887766, 0x997755
|
||||||
dd 0x00334455, 0x00445566, 0x00334455, 0x00223344
|
; dd 0x334455, 0x445566, 0x556677, 0x667788, 0x777799, 0x887766, 0x997755, 0xAA7744
|
||||||
dd 0x00445566, 0x00334455, 0x00223344, 0x00112233
|
; dd 0x445566, 0x556677, 0x667788, 0x777799, 0x887766, 0x997755, 0xAA7744, 0xBB7733
|
||||||
|
; dd 0x334455, 0x445566, 0x556677, 0x667788, 0x777799, 0x887766, 0x997755, 0xAA7744
|
||||||
|
; dd 0x223344, 0x334455, 0x445566, 0x556677, 0x667788, 0x777799, 0x887766, 0x997755
|
||||||
|
; dd 0x112233, 0x223344, 0x334455, 0x445566, 0x556677, 0x667788, 0x777799, 0x887766
|
||||||
|
; dd 0x001122, 0x112233, 0x223344, 0x334455, 0x445566, 0x556677, 0x667788, 0x777799
|
||||||
|
; dd 0x220000, 0x001122, 0x112233, 0x223344, 0x334455, 0x445566, 0x556677, 0x667788
|
||||||
|
; dd 0x441100, 0x220000, 0x001122, 0x112233, 0x223344, 0x334455, 0x445566, 0x556677
|
||||||
|
|
||||||
|
;align 64
|
||||||
|
;img_test_struct_24: ; 8 x 16
|
||||||
|
; dw 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211, 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB
|
||||||
|
; dw 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB, 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211
|
||||||
|
; dw 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211, 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB
|
||||||
|
; dw 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB, 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211
|
||||||
|
; dw 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211, 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB
|
||||||
|
; dw 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB, 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211
|
||||||
|
; dw 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211, 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB
|
||||||
|
; dw 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB, 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211
|
||||||
|
; dw 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211, 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB
|
||||||
|
; dw 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB, 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211
|
||||||
|
; dw 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211, 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB
|
||||||
|
; dw 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB, 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211
|
||||||
|
; dw 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211, 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB
|
||||||
|
; dw 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB, 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211
|
||||||
|
; dw 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211, 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB
|
||||||
|
; dw 0xBBAA, 0xAACC, 0xCCBB, 0xBBAA, 0xAACC, 0xCCBB, 0x1100, 0x0022, 0x2211, 0x1100, 0x0022, 0x2211
|
||||||
|
|
||||||
|
;align 64
|
||||||
|
;img_test_struct_8: ; 20 x 10
|
||||||
|
; db 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0
|
||||||
|
; db 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0
|
||||||
|
; db 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0
|
||||||
|
; db 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0
|
||||||
|
; db 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0
|
||||||
|
; db 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0
|
||||||
|
; db 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0
|
||||||
|
; db 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0
|
||||||
|
; db 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0
|
||||||
|
; db 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0
|
||||||
|
|
||||||
|
;align 64
|
||||||
|
;img_test_struct_1: ; 16 x 10
|
||||||
|
; db 0x0F, 0xF0
|
||||||
|
; db 0x0F, 0xF0
|
||||||
|
; db 0x3C, 0xC3
|
||||||
|
; db 0x3C, 0xC3
|
||||||
|
; db 0xF0, 0x0F
|
||||||
|
; db 0xF0, 0x0F
|
||||||
|
; db 0x3C, 0xC3
|
||||||
|
; db 0x3C, 0xC3
|
||||||
|
; db 0x0F, 0xF0
|
||||||
|
; db 0x0F, 0xF0
|
||||||
|
|
||||||
|
;align 64
|
||||||
|
;img_test_palette: ; 6 colors
|
||||||
|
; dd 0x00BB2233, 0xAA4466, 0x995555, 0x00339966, 0x00884455, 0x00775566, 0x00664455, 0x00553344, 0x0
|
||||||
|
|
||||||
;**************************************************************************************
|
;**************************************************************************************
|
||||||
align 4
|
align 4
|
||||||
__sys_putpixel:
|
__sys_putpixel:
|
||||||
|
push edx
|
||||||
|
mov edx, [TASK_BASE]
|
||||||
|
add eax, [edx-twdw+WDATA.box.left]
|
||||||
|
add ebx, [edx-twdw+WDATA.box.top]
|
||||||
|
pop edx
|
||||||
_putpixel:
|
_putpixel:
|
||||||
|
|
||||||
; eax = x coordinate
|
; eax = x coordinate
|
||||||
@ -539,14 +646,13 @@ _putpixel:
|
|||||||
|
|
||||||
.not_forced:
|
.not_forced:
|
||||||
push ebx eax
|
push ebx eax
|
||||||
shr eax, 1
|
shr eax, 2
|
||||||
shr eax, 1
|
|
||||||
shr ebx, 1
|
shr ebx, 1
|
||||||
imul ebx, [_WinMapWidth] ; win_map (X size)/2
|
imul ebx, [_WinMapWidth] ; win_map (X size)/2
|
||||||
add ebx, eax
|
add ebx, eax
|
||||||
mov al, byte [CURRENT_TASK]
|
mov al, byte [CURRENT_TASK]
|
||||||
mov bl, byte [_WinMapAddress+ebx]
|
mov ah, byte [_WinMapAddress+ebx]
|
||||||
cmp bl, al
|
cmp ah, al
|
||||||
pop eax ebx
|
pop eax ebx
|
||||||
jne .exit0
|
jne .exit0
|
||||||
.checked:
|
.checked:
|
||||||
@ -565,15 +671,15 @@ _putpixel:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
align 4
|
;align 4
|
||||||
put_pixel: ; left for compatibility with Vesa20_putpixel32
|
;_put_pixel: ; left for compatibility with Vesa20_putpixel32
|
||||||
; eax = x
|
;; eax = x
|
||||||
; ebx = y
|
;; ebx = y
|
||||||
imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
|
; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
|
||||||
lea edi, [ebx+eax*4] ; edi = x*4+(y*y multiplier)
|
; lea edi, [ebx+eax*4] ; edi = x*4+(y*y multiplier)
|
||||||
; mov eax, [esp+32-8+4] ; eax = color
|
;; mov eax, [esp+32-8+4] ; eax = color
|
||||||
mov [LFB_BASE+edi], ecx
|
; mov [LFB_BASE+edi], ecx
|
||||||
ret
|
; ret
|
||||||
|
|
||||||
|
|
||||||
; DRAWLINE
|
; DRAWLINE
|
||||||
@ -748,7 +854,7 @@ hline:
|
|||||||
mov ecx, [ebp] ; check the line segment (16 pixels!)
|
mov ecx, [ebp] ; check the line segment (16 pixels!)
|
||||||
xor ecx, [CURRENT_TASK]
|
xor ecx, [CURRENT_TASK]
|
||||||
; -- the line ---
|
; -- the line ---
|
||||||
jmp dword [hline.drawtable + edi*4] ; a coolhack (C) Serge
|
jmp dword [hline.drawtable + edi*4] ; (C) Serge, 2010
|
||||||
|
|
||||||
|
|
||||||
align 4 ; internal loop
|
align 4 ; internal loop
|
||||||
@ -885,235 +991,70 @@ dd .invert_force
|
|||||||
;*************************************************
|
;*************************************************
|
||||||
|
|
||||||
|
|
||||||
virtual at esp
|
|
||||||
drbar:
|
|
||||||
.bar_sx dd ?
|
|
||||||
.bar_sy dd ?
|
|
||||||
.bar_cx dd ?
|
|
||||||
.bar_cy dd ?
|
|
||||||
.abs_cx dd ?
|
|
||||||
.abs_cy dd ?
|
|
||||||
.real_sx dd ?
|
|
||||||
.real_sy dd ?
|
|
||||||
.color dd ?
|
|
||||||
.line_inc_scr dd ?
|
|
||||||
.line_inc_map dd ?
|
|
||||||
.stack_data = 4*11
|
|
||||||
end virtual
|
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
; eax cx
|
; eax xOrigin
|
||||||
; ebx cy
|
; ebx yOrigin
|
||||||
; ecx xe
|
; ecx xSize
|
||||||
; edx ye
|
; edx ySize
|
||||||
; edi color
|
; edi color
|
||||||
vesa20_drawbar:
|
|
||||||
|
_drawbar:
|
||||||
pushad
|
pushad
|
||||||
call [_display.disable_mouse]
|
sub esp, putimg.stack_data
|
||||||
sub esp, drbar.stack_data
|
mov [img_bytes_per_pix], 0
|
||||||
mov [drbar.color], edi
|
mov [img_buf_line_size], 0
|
||||||
sub edx, ebx
|
mov [img_draw_core_fn], draw_core_0bpp
|
||||||
jle .exit
|
mov [img_draw_edge_fn], draw_edge_0bpp
|
||||||
sub ecx, eax
|
mov [putimg.image_sx], ecx
|
||||||
jle .exit
|
mov [putimg.image_sy], edx
|
||||||
mov [drbar.bar_sy], edx
|
mov edx, ebx
|
||||||
mov [drbar.bar_sx], ecx
|
mov [img_palette], edi
|
||||||
mov [drbar.bar_cx], eax
|
mov esi, img_palette
|
||||||
mov [drbar.bar_cy], ebx
|
mov [img_buf_origin], esi
|
||||||
mov edi, [TASK_BASE]
|
|
||||||
add eax, [edi-twdw + WDATA.box.left] ; win_cx
|
|
||||||
add ebx, [edi-twdw + WDATA.box.top] ; win_cy
|
|
||||||
mov [drbar.abs_cx], eax
|
|
||||||
mov [drbar.abs_cy], ebx
|
|
||||||
; real_sx = MIN(wnd_sx-bar_cx, bar_sx);
|
|
||||||
mov ebx, [edi-twdw + WDATA.box.width] ; ebx = wnd_sx
|
|
||||||
; note that WDATA.box.width is one pixel less than real window x-size
|
|
||||||
inc ebx
|
|
||||||
sub ebx, [drbar.bar_cx]
|
|
||||||
ja @f
|
|
||||||
.exit:
|
|
||||||
add esp, drbar.stack_data
|
|
||||||
popad
|
|
||||||
xor eax, eax
|
|
||||||
inc eax
|
|
||||||
ret
|
|
||||||
@@:
|
|
||||||
cmp ebx, [drbar.bar_sx]
|
|
||||||
jbe .end_x
|
|
||||||
mov ebx, [drbar.bar_sx]
|
|
||||||
.end_x:
|
|
||||||
mov [drbar.real_sx], ebx
|
|
||||||
; real_sy = MIN(wnd_sy-bar_cy, bar_sy);
|
|
||||||
mov ebx, [edi-twdw + WDATA.box.height] ; ebx = wnd_sy
|
|
||||||
inc ebx
|
|
||||||
sub ebx, [drbar.bar_cy]
|
|
||||||
ja @f
|
|
||||||
add esp, drbar.stack_data
|
|
||||||
popad
|
|
||||||
xor eax, eax
|
|
||||||
inc eax
|
|
||||||
ret
|
|
||||||
@@:
|
|
||||||
cmp ebx, [drbar.bar_sy]
|
|
||||||
jbe .end_y
|
|
||||||
mov ebx, [drbar.bar_sy]
|
|
||||||
.end_y:
|
|
||||||
mov [drbar.real_sy], ebx
|
|
||||||
; line_inc_map
|
|
||||||
mov eax, [Screen_Max_X]
|
|
||||||
sub eax, [drbar.real_sx]
|
|
||||||
inc eax
|
|
||||||
shr eax, 1 ; <<<<<<
|
|
||||||
shr eax, 1
|
|
||||||
mov [drbar.line_inc_map], eax ; vertical increment: map
|
|
||||||
; line_inc_scr
|
|
||||||
mov eax, [drbar.real_sx]
|
|
||||||
shl eax, 1
|
|
||||||
shl eax, 1
|
|
||||||
neg eax
|
|
||||||
add eax, [BytesPerScanLine]
|
|
||||||
mov [drbar.line_inc_scr], eax ; vertical increment: screen
|
|
||||||
; pointer to screen
|
|
||||||
mov edx, [drbar.abs_cy]
|
|
||||||
mov ebx, edx
|
|
||||||
imul edx, [BytesPerScanLine] ; edx = LFB line offset
|
|
||||||
mov eax, [drbar.abs_cx]
|
|
||||||
shl eax, 1
|
|
||||||
shl eax, 1
|
|
||||||
add edx, eax ; edx = LFB corner offset
|
|
||||||
; pointer to pixel map
|
|
||||||
shr ebx, 1
|
|
||||||
imul ebx, [_WinMapWidth] ; eax = Wmap corner pos
|
|
||||||
mov eax, [drbar.abs_cx]
|
|
||||||
shr eax, 1
|
|
||||||
shr eax, 1
|
|
||||||
add eax, ebx
|
|
||||||
add eax, [_WinMapAddress]
|
|
||||||
xchg eax, ebp ; ebp = Wmap corner
|
|
||||||
; get process number
|
|
||||||
mov ebx, [CURRENT_TASK]
|
|
||||||
|
|
||||||
; eax - RGB-color
|
jmp _putimage.calculate_abs_coords
|
||||||
; bl - process num
|
; ret
|
||||||
; ecx - pix counter (in a tile)
|
|
||||||
; edx - pointer to screen
|
|
||||||
; esi - counter
|
|
||||||
; edi - counter
|
|
||||||
|
|
||||||
mov eax, [drbar.color] ;; BBGGRR00
|
|
||||||
mov esi, 0
|
|
||||||
align 4
|
|
||||||
.new_y:
|
|
||||||
mov edi, [drbar.real_sx]
|
|
||||||
movzx ecx, dl
|
|
||||||
shr cl, 2 ; pix# = edx/4
|
|
||||||
and cl, 3 ; pix position in a tile
|
|
||||||
.new_tile:
|
|
||||||
cmp byte [ebp], bl
|
|
||||||
jne .skip
|
|
||||||
.new_x:
|
|
||||||
mov [LFB_BASE+edx], eax
|
|
||||||
add edx, 4
|
|
||||||
dec edi
|
|
||||||
jz .add_line
|
|
||||||
inc cl
|
|
||||||
and cl, 3
|
|
||||||
jnz .new_x
|
|
||||||
jmp .new_tile
|
|
||||||
.skip:
|
|
||||||
add edx, 4*4
|
|
||||||
and dl, 0xF0 ; LFB align 16
|
|
||||||
inc ebp
|
|
||||||
sub edi, 4 ; <<<<<
|
|
||||||
add edi, ecx ; left tile may be 1,2 or 3px only
|
|
||||||
jae .new_tile
|
|
||||||
|
|
||||||
.add_line:
|
|
||||||
add edx, [drbar.line_inc_scr]
|
|
||||||
; gradient-filled bars
|
|
||||||
test eax, 0x80000000
|
|
||||||
jz @f
|
|
||||||
test al, al
|
|
||||||
jz @f
|
|
||||||
dec al
|
|
||||||
@@:
|
|
||||||
inc esi
|
|
||||||
test esi, 1
|
|
||||||
jne @f
|
|
||||||
add ebp, [drbar.line_inc_map]
|
|
||||||
@@:
|
|
||||||
cmp esi, [drbar.real_sy]
|
|
||||||
jbe .new_y
|
|
||||||
add esp, drbar.stack_data
|
|
||||||
popad
|
|
||||||
xor eax, eax
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
align 4
|
draw_background:
|
||||||
;drawbackground:
|
|
||||||
call [_display.disable_mouse]
|
|
||||||
pushad
|
pushad
|
||||||
; External loop for all y from start to end
|
pushfd
|
||||||
mov ebx, [draw_data+32+RECT.top] ; y start
|
cld ; increment edi here!
|
||||||
.fill_line:
|
mov ebp, [_WinMapAddress]
|
||||||
mov edi, [draw_data+32+RECT.left] ; x start
|
mov eax, 0x00337766 ; bgndcolor
|
||||||
shl edi, 1
|
mov bl, 1
|
||||||
shl edi, 1
|
mov edx, [Screen_Max_X]
|
||||||
mov eax, [BytesPerScanLine]
|
|
||||||
mul ebx
|
|
||||||
xchg edi, eax
|
|
||||||
add edi, eax
|
|
||||||
add edi, LFB_BASE
|
|
||||||
|
|
||||||
mov ebp, ebx
|
|
||||||
shr ebp, 1
|
|
||||||
imul ebp, [_WinMapWidth]
|
|
||||||
mov edx, eax
|
|
||||||
shr edx, 1
|
shr edx, 1
|
||||||
shr edx, 1
|
mov edi, LFB_BASE
|
||||||
add ebp, edx
|
mov esi, [BytesPerScanLine]
|
||||||
add ebp, [_WinMapAddress]
|
.new_row:
|
||||||
xor edx, edx
|
xor ecx, ecx
|
||||||
inc edx
|
.fill:
|
||||||
mov esi, 0x0336677 ; <<< RGB
|
cmp byte [ebp+ecx], bl
|
||||||
; eax = x, ebx = y (screen coordinates)
|
jne .next
|
||||||
; ecx - aux. var
|
|
||||||
; edx = 1
|
|
||||||
; esi = 0RGB, edi -> output
|
|
||||||
; ebp = offset in WinMapAddress
|
|
||||||
.fill_tile:
|
|
||||||
cmp [ebp], dl
|
|
||||||
jnz .next_tile
|
|
||||||
mov [edi], esi
|
|
||||||
mov [edi+4], esi
|
|
||||||
mov [edi+8], esi
|
|
||||||
mov [edi+12],esi
|
|
||||||
mov ecx, [BytesPerScanLine]
|
|
||||||
mov [ecx+edi], esi
|
|
||||||
mov [ecx+edi+4], esi
|
|
||||||
mov [ecx+edi+8], esi
|
|
||||||
mov [ecx+edi+12],esi
|
|
||||||
.next_tile:
|
|
||||||
add edi, 4*4
|
|
||||||
add ebp, edx
|
|
||||||
add ax, 4
|
|
||||||
mov ecx, [draw_data+32+RECT.right]
|
|
||||||
shr ecx, 1
|
|
||||||
shr ecx, 1
|
|
||||||
cmp eax, ecx
|
|
||||||
jbe .fill_tile
|
|
||||||
|
|
||||||
.next_line:
|
mov [edi+esi], eax ; fill all 8 pixels of this tile
|
||||||
inc ebx
|
stosd
|
||||||
mov ecx, [draw_data+32+RECT.bottom]
|
mov [edi+esi], eax
|
||||||
shr ecx, 1
|
stosd
|
||||||
jbe .fill_line
|
mov [edi+esi], eax
|
||||||
|
stosd
|
||||||
|
mov [edi+esi], eax
|
||||||
|
stosd
|
||||||
|
.next: inc ecx
|
||||||
|
cmp ecx, [_WinMapWidth]
|
||||||
|
jb .fill
|
||||||
|
dec edx
|
||||||
|
jz .done
|
||||||
|
add ebp, ecx ; += [_WinMapWidth]
|
||||||
|
add edi, esi ; += [BytesPerScanLine]
|
||||||
|
jmp .new_row
|
||||||
|
.done:
|
||||||
|
popfd
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; ----------
|
|
||||||
|
|
||||||
|
|
||||||
drawbackground_stretch: ; left for future development
|
drawbackground_stretch: ; left for future development
|
||||||
call drawbackground
|
call drawbackground
|
||||||
@ -1128,109 +1069,27 @@ bgr_cur_line rd 1920 ; maximum width of screen
|
|||||||
bgr_next_line rd 1920
|
bgr_next_line rd 1920
|
||||||
endg
|
endg
|
||||||
|
|
||||||
smooth_line:
|
|
||||||
mov al, [esi+2]
|
_init_background:
|
||||||
shl eax, 16
|
; mov edi, BgrAuxTable
|
||||||
mov ax, [esi]
|
; xor edx, edx
|
||||||
test ecx, ecx
|
;.loop2:
|
||||||
jz @f
|
; mov eax, edx
|
||||||
mov ebx, [esi+2]
|
; shl eax, 8
|
||||||
shr ebx, 8
|
; neg eax
|
||||||
call [overlapping_of_points_ptr]
|
; mov ecx, 0x200
|
||||||
@@:
|
;.loop1:
|
||||||
stosd
|
; mov byte [edi], ah
|
||||||
mov eax, [esp+20+8]
|
; inc edi
|
||||||
inc eax
|
; add eax, edx
|
||||||
mov [esp+20+8], eax
|
; loop .loop1
|
||||||
cmp eax, [draw_data+32+RECT.right]
|
; add dl, 4
|
||||||
ja @f
|
; jnz .loop2
|
||||||
add ecx, [esp+36+8]
|
mov byte [REDRAW_BACKGROUND], 1
|
||||||
mov eax, edx
|
; mov dword[BgrAuxTable], 0x00337766
|
||||||
adc edx, [esp+40+8]
|
|
||||||
sub eax, edx
|
|
||||||
lea eax, [eax*3]
|
|
||||||
sub esi, eax
|
|
||||||
jmp smooth_line
|
|
||||||
@@:
|
|
||||||
mov eax, [draw_data+32+RECT.left]
|
|
||||||
mov [esp+20+8], eax
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
align 16
|
|
||||||
overlapping_of_points:
|
|
||||||
push ecx edx
|
|
||||||
mov edx, eax
|
|
||||||
push esi
|
|
||||||
shr ecx, 26
|
|
||||||
mov esi, ecx
|
|
||||||
mov ecx, ebx
|
|
||||||
shl esi, 9
|
|
||||||
movzx ebx, dl
|
|
||||||
movzx eax, cl
|
|
||||||
sub eax, ebx
|
|
||||||
movzx ebx, dh
|
|
||||||
add dl, [BgrAuxTable+(eax+0x100)+esi]
|
|
||||||
movzx eax, ch
|
|
||||||
sub eax, ebx
|
|
||||||
add dh, [BgrAuxTable+(eax+0x100)+esi]
|
|
||||||
ror ecx, 16
|
|
||||||
ror edx, 16
|
|
||||||
movzx eax, cl
|
|
||||||
movzx ebx, dl
|
|
||||||
sub eax, ebx
|
|
||||||
add dl, [BgrAuxTable+(eax+0x100)+esi]
|
|
||||||
pop esi
|
|
||||||
mov eax, edx
|
|
||||||
pop edx
|
|
||||||
ror eax, 16
|
|
||||||
pop ecx
|
|
||||||
ret
|
|
||||||
|
|
||||||
iglobal
|
|
||||||
align 4
|
|
||||||
overlapping_of_points_ptr dd overlapping_of_points
|
|
||||||
endg
|
|
||||||
|
|
||||||
init_background:
|
|
||||||
mov edi, BgrAuxTable
|
|
||||||
xor edx, edx
|
|
||||||
.loop2:
|
|
||||||
mov eax, edx
|
|
||||||
shl eax, 8
|
|
||||||
neg eax
|
|
||||||
mov ecx, 0x200
|
|
||||||
.loop1:
|
|
||||||
mov byte [edi], ah
|
|
||||||
inc edi
|
|
||||||
add eax, edx
|
|
||||||
loop .loop1
|
|
||||||
add dl, 4
|
|
||||||
jnz .loop2
|
|
||||||
test byte [cpu_caps+(CAPS_MMX/8)], 1 shl (CAPS_MMX mod 8)
|
|
||||||
jz @f
|
|
||||||
mov [overlapping_of_points_ptr], overlapping_of_points_mmx
|
|
||||||
@@:
|
|
||||||
ret
|
|
||||||
|
|
||||||
align 16
|
|
||||||
overlapping_of_points_mmx:
|
|
||||||
movd mm0, eax
|
|
||||||
movd mm4, eax
|
|
||||||
movd mm1, ebx
|
|
||||||
pxor mm2, mm2
|
|
||||||
punpcklbw mm0, mm2
|
|
||||||
punpcklbw mm1, mm2
|
|
||||||
psubw mm1, mm0
|
|
||||||
movd mm3, ecx
|
|
||||||
psrld mm3, 24
|
|
||||||
packuswb mm3, mm3
|
|
||||||
packuswb mm3, mm3
|
|
||||||
pmullw mm1, mm3
|
|
||||||
psrlw mm1, 8
|
|
||||||
packuswb mm1, mm2
|
|
||||||
paddb mm4, mm1
|
|
||||||
movd eax, mm4
|
|
||||||
ret
|
|
||||||
diff16 "GRAPH32 code end ",0,$
|
diff16 "GRAPH32 code end ",0,$
|
||||||
diff10 "GRAPH32 code size",get_pixel,$
|
diff10 "GRAPH32 code size",get_pixel,$
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user