forked from KolibriOS/kolibrios
replace all vars whith symbolic constants
git-svn-id: svn://kolibrios.org@381 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
a90d0cfe1d
commit
1ced1382c9
@ -41,8 +41,8 @@ save_image:
|
||||
jne unnecessary_save_image
|
||||
mov [FDD_Track],0 ; Öčëčíäđ
|
||||
mov [FDD_Head],0 ; Ńňîđîíŕ
|
||||
mov [FDD_Sector],1 ; Ñåêòîð
|
||||
mov esi,0x100000
|
||||
mov [FDD_Sector],1 ; Ñåêòîð
|
||||
mov esi,RAMDISK
|
||||
call SeekTrack
|
||||
save_image_1:
|
||||
push esi
|
||||
@ -57,7 +57,7 @@ save_image_1:
|
||||
cmp [FDD_Sector],19
|
||||
jne save_image_1
|
||||
mov [FDD_Sector],1
|
||||
inc [FDD_Head]
|
||||
inc [FDD_Head]
|
||||
cmp [FDD_Head],2
|
||||
jne save_image_1
|
||||
mov [FDD_Head],0
|
||||
|
@ -12,8 +12,8 @@ calculatefatchain:
|
||||
|
||||
pushad
|
||||
|
||||
mov esi,0x100000+512
|
||||
mov edi,0x280000
|
||||
mov esi,RAMDISK+512
|
||||
mov edi,RAMDISK_FAT
|
||||
|
||||
fcnew:
|
||||
mov eax,dword [esi]
|
||||
@ -38,7 +38,7 @@ calculatefatchain:
|
||||
add edi,16
|
||||
add esi,12
|
||||
|
||||
cmp edi,0x280000+2856*2 ;2849 clusters
|
||||
cmp edi,RAMDISK_FAT+2856*2 ;2849 clusters
|
||||
jnz fcnew
|
||||
|
||||
popad
|
||||
@ -49,8 +49,8 @@ restorefatchain: ; restore fat chain
|
||||
|
||||
pushad
|
||||
|
||||
mov esi,0x280000
|
||||
mov edi,0x100000+512
|
||||
mov esi,RAMDISK_FAT
|
||||
mov edi,RAMDISK+512
|
||||
|
||||
fcnew2:
|
||||
mov eax,dword [esi]
|
||||
@ -66,11 +66,11 @@ restorefatchain: ; restore fat chain
|
||||
add edi,6
|
||||
add esi,8
|
||||
|
||||
cmp edi,0x100000+512+4278 ;4274 bytes - all used FAT
|
||||
cmp edi,RAMDISK+512+4278 ;4274 bytes - all used FAT
|
||||
jb fcnew2
|
||||
|
||||
mov esi,0x100000+512 ; duplicate fat chain
|
||||
mov edi,0x100000+512+0x1200
|
||||
mov esi,RAMDISK+512 ; duplicate fat chain
|
||||
mov edi,RAMDISK+512+0x1200
|
||||
mov ecx,1069 ;4274/4
|
||||
cld
|
||||
rep movsd
|
||||
@ -88,7 +88,7 @@ ramdisk_free_space:
|
||||
|
||||
push eax ebx ecx
|
||||
|
||||
mov edi,0x280000 ;start of FAT
|
||||
mov edi,RAMDISK_FAT ;start of FAT
|
||||
xor ax,ax ;Free cluster=0x0000 in FAT
|
||||
xor ebx,ebx ;counter
|
||||
mov ecx,2849 ;2849 clusters
|
||||
@ -202,7 +202,7 @@ fileread:
|
||||
sub ecx,edx
|
||||
fr_do1:
|
||||
shl ebx,9
|
||||
mov esi,0x100000+512*19
|
||||
mov esi,RAMDISK+512*19
|
||||
add esi,ebx
|
||||
shl ecx,7
|
||||
cld
|
||||
@ -246,7 +246,7 @@ fileread:
|
||||
|
||||
add eax,31 ;bootsector+2*fat+filenames
|
||||
shl eax,9 ;*512
|
||||
add eax,0x100000 ;image base
|
||||
add eax,RAMDISK ;image base
|
||||
mov ebx,[esp+8]
|
||||
mov ecx,512 ;[esp+4]
|
||||
|
||||
@ -260,7 +260,7 @@ fileread:
|
||||
frfl7:
|
||||
dec dword [esp+16]
|
||||
frfl8:
|
||||
movzx eax,word [edi*2+0x280000] ; find next cluster from FAT
|
||||
movzx eax,word [edi*2+RAMDISK_FAT] ; find next cluster from FAT
|
||||
mov edi,eax
|
||||
cmp edi,4095 ;eof - cluster
|
||||
jz frnoread2
|
||||
@ -326,7 +326,7 @@ filedelete:
|
||||
frnewd:
|
||||
|
||||
shl edi,1 ;find next cluster from FAT
|
||||
add edi,0x280000
|
||||
add edi,RAMDISK_FAT
|
||||
movzx eax,word [edi]
|
||||
mov [edi],word 0x0 ;clear fat chain cluster
|
||||
mov edi,eax
|
||||
@ -375,7 +375,7 @@ filesave:
|
||||
|
||||
push eax ebx ecx edx esi edi
|
||||
|
||||
mov edi,0x100000+512*18+512 ;Point at directory
|
||||
mov edi,RAMDISK+512*18+512 ;Point at directory
|
||||
mov edx,224 +1
|
||||
; find an empty spot for filename in the root dir
|
||||
l20ds:
|
||||
@ -407,7 +407,7 @@ mov [edi+24],ax ; date
|
||||
call get_time_for_file ; from FAT32.INC
|
||||
mov [edi+22],ax ; time
|
||||
; End
|
||||
mov edi,0x280000 ;pointer to first cluster
|
||||
mov edi,RAMDISK_FAT ;pointer to first cluster
|
||||
mov ecx,2849
|
||||
cld
|
||||
frnewds:
|
||||
@ -423,7 +423,7 @@ mov [edi+22],ax ; time
|
||||
pusha ; move save to floppy cluster
|
||||
add ebx,31
|
||||
shl ebx,9
|
||||
add ebx,0x100000
|
||||
add ebx,RAMDISK
|
||||
mov eax,[esp+32+16]
|
||||
mov ecx,512
|
||||
call memmove
|
||||
@ -458,7 +458,7 @@ mov [edi+22],ax ; time
|
||||
;by Mihasik
|
||||
;IN: eax - pointer to filename OUT: filestring+11 in edi or notZero in flags and fnf in eax,ebx
|
||||
|
||||
mov edi,0x100000+512*18+512 ;Point at directory
|
||||
mov edi,RAMDISK+512*18+512 ;Point at directory
|
||||
cld
|
||||
rd_newsearch:
|
||||
mov esi,eax
|
||||
@ -467,7 +467,7 @@ mov [edi+22],ax ; time
|
||||
je rd_ff
|
||||
add cl,21
|
||||
add edi,ecx
|
||||
cmp edi,0x100000+512*33
|
||||
cmp edi,RAMDISK+512*33
|
||||
jb rd_newsearch
|
||||
mov eax,5 ;if file not found - eax=5
|
||||
xor ebx,ebx
|
||||
@ -902,12 +902,12 @@ bdfe_to_fat_entry:
|
||||
ret
|
||||
|
||||
ramdisk_root_first:
|
||||
mov edi, 0x100000+512*19
|
||||
mov edi, RAMDISK+512*19
|
||||
clc
|
||||
ret
|
||||
ramdisk_root_next:
|
||||
add edi, 0x20
|
||||
cmp edi, 0x100000+512*33
|
||||
cmp edi, RAMDISK+512*33
|
||||
cmc
|
||||
ret
|
||||
|
||||
@ -932,7 +932,7 @@ ramdisk_notroot_next_sector:
|
||||
push [rd_prev_sector]
|
||||
pop [rd_prev_prev_sector]
|
||||
mov [rd_prev_sector], ecx
|
||||
mov ecx, [ecx*2+0x280000]
|
||||
mov ecx, [ecx*2+RAMDISK_FAT]
|
||||
and ecx, 0xFFF
|
||||
cmp ecx, 2849
|
||||
jae ramdisk_notroot_first.err2
|
||||
@ -945,7 +945,7 @@ ramdisk_notroot_first:
|
||||
cmp eax, 2849
|
||||
jae .err
|
||||
shl eax, 9
|
||||
lea edi, [eax+(31 shl 9)+0x100000]
|
||||
lea edi, [eax+(31 shl 9)+RAMDISK]
|
||||
clc
|
||||
ret
|
||||
.err2:
|
||||
@ -962,20 +962,20 @@ ramdisk_root_next_write:
|
||||
ramdisk_notroot_extend_dir:
|
||||
pusha
|
||||
xor eax, eax
|
||||
mov edi, 0x280000
|
||||
mov edi, RAMDISK_FAT
|
||||
mov ecx, 2849
|
||||
repnz scasw
|
||||
jnz .notfound
|
||||
mov word [edi-2], 0xFFF
|
||||
sub edi, 0x280000
|
||||
sub edi, RAMDISK_FAT
|
||||
shr edi, 1
|
||||
dec edi
|
||||
mov eax, [esp+28]
|
||||
mov ecx, [eax]
|
||||
mov [0x280000+ecx*2], di
|
||||
mov [RAMDISK_FAT+ecx*2], di
|
||||
mov [eax], edi
|
||||
shl edi, 9
|
||||
add edi, (31 shl 9)+0x100000
|
||||
add edi, (31 shl 9)+RAMDISK
|
||||
mov [esp], edi
|
||||
xor eax, eax
|
||||
mov ecx, 128
|
||||
@ -1079,7 +1079,7 @@ fs_RamdiskRead:
|
||||
jae .eof
|
||||
lea eax, [edi+31] ; bootsector+2*fat+filenames
|
||||
shl eax, 9 ; *512
|
||||
add eax, 0x100000 ; image base
|
||||
add eax, RAMDISK ; image base
|
||||
; now eax points to data of cluster
|
||||
sub ebx, 512
|
||||
jae .skip
|
||||
@ -1097,7 +1097,7 @@ fs_RamdiskRead:
|
||||
pop ecx
|
||||
xor ebx, ebx
|
||||
.skip:
|
||||
movzx edi, word [edi*2+0x280000] ; find next cluster from FAT
|
||||
movzx edi, word [edi*2+RAMDISK_FAT] ; find next cluster from FAT
|
||||
jmp .new
|
||||
.eof:
|
||||
mov ebx, edx
|
||||
@ -1168,7 +1168,7 @@ fs_RamdiskReadFolder:
|
||||
.main_loop:
|
||||
mov edi, eax
|
||||
shl edi, 9
|
||||
add edi, 0x100000
|
||||
add edi, RAMDISK
|
||||
push eax
|
||||
.l1:
|
||||
call fat_get_name
|
||||
@ -1184,7 +1184,7 @@ fs_RamdiskReadFolder:
|
||||
jz .done
|
||||
jns @f
|
||||
; read next sector from FAT
|
||||
mov eax, [(eax-31-1)*2+0x280000]
|
||||
mov eax, [(eax-31-1)*2+RAMDISK_FAT]
|
||||
and eax, 0xFFF
|
||||
cmp eax, 0xFF8
|
||||
jae .done
|
||||
@ -1193,7 +1193,7 @@ fs_RamdiskReadFolder:
|
||||
@@:
|
||||
mov edi, eax
|
||||
shl edi, 9
|
||||
add edi, 0x100000
|
||||
add edi, RAMDISK
|
||||
push eax
|
||||
.do_bdfe:
|
||||
inc dword [edx+8] ; new file found
|
||||
@ -1213,7 +1213,7 @@ fs_RamdiskReadFolder:
|
||||
jz .done
|
||||
jns @f
|
||||
; read next sector from FAT
|
||||
mov eax, [(eax-31-1)*2+0x280000]
|
||||
mov eax, [(eax-31-1)*2+RAMDISK_FAT]
|
||||
and eax, 0xFFF
|
||||
cmp eax, 0xFF8
|
||||
jae .done
|
||||
@ -1993,7 +1993,7 @@ fs_RamdiskWrite:
|
||||
@@:
|
||||
mov eax, edi
|
||||
shl eax, 9
|
||||
add eax, 0x100000+31*512+0x200
|
||||
add eax, RAMDISK+31*512+0x200
|
||||
sub eax, ebx
|
||||
mov ebx, eax
|
||||
mov eax, edx
|
||||
@ -2004,7 +2004,7 @@ fs_RamdiskWrite:
|
||||
pop ecx
|
||||
jz .ret
|
||||
.next_cluster:
|
||||
movzx edi, word [edi*2+0x280000]
|
||||
movzx edi, word [edi*2+RAMDISK_FAT]
|
||||
jmp .write_loop
|
||||
|
||||
ramdisk_extend_file.zero_size:
|
||||
@ -2024,7 +2024,7 @@ ramdisk_extend_file:
|
||||
@@:
|
||||
sub ecx, 0x200
|
||||
jbe @f
|
||||
mov eax, [eax*2+0x280000]
|
||||
mov eax, [eax*2+RAMDISK_FAT]
|
||||
and eax, 0xFFF
|
||||
jz .fat_err
|
||||
cmp eax, 0xFF8
|
||||
@ -2037,7 +2037,7 @@ ramdisk_extend_file:
|
||||
ret
|
||||
@@:
|
||||
push eax
|
||||
mov eax, [eax*2+0x280000]
|
||||
mov eax, [eax*2+RAMDISK_FAT]
|
||||
and eax, 0xFFF
|
||||
cmp eax, 0xFF8
|
||||
pop eax
|
||||
@ -2047,7 +2047,7 @@ ramdisk_extend_file:
|
||||
push eax edi
|
||||
mov edi, eax
|
||||
shl edi, 9
|
||||
lea edi, [edi+0x100000+31*512+0x200+ecx]
|
||||
lea edi, [edi+RAMDISK+31*512+0x200+ecx]
|
||||
neg ecx
|
||||
xor eax, eax
|
||||
rep stosb
|
||||
@ -2056,7 +2056,7 @@ ramdisk_extend_file:
|
||||
pop ecx
|
||||
; now do extend
|
||||
push edx esi
|
||||
mov esi, 0x280000+2*2 ; start scan from cluster 2
|
||||
mov esi, RAMDISK_FAT+2*2 ; start scan from cluster 2
|
||||
mov edx, 2847 ; number of clusters to scan
|
||||
.extend_loop:
|
||||
cmp [edi+28], ecx
|
||||
@ -2075,12 +2075,12 @@ ramdisk_extend_file:
|
||||
mov word [edi-2], 0xFFF
|
||||
mov esi, edi
|
||||
mov edx, ecx
|
||||
sub edi, 0x280000
|
||||
sub edi, RAMDISK_FAT
|
||||
shr edi, 1
|
||||
dec edi ; now edi=new cluster
|
||||
test eax, eax
|
||||
jz .first_cluster
|
||||
mov [0x280000+eax*2], di
|
||||
mov [RAMDISK_FAT+eax*2], di
|
||||
jmp @f
|
||||
.first_cluster:
|
||||
pop eax ; eax->direntry
|
||||
@ -2089,7 +2089,7 @@ ramdisk_extend_file:
|
||||
@@:
|
||||
push edi
|
||||
shl edi, 9
|
||||
add edi, 0x100000+31*512
|
||||
add edi, RAMDISK+31*512
|
||||
xor eax, eax
|
||||
mov ecx, 512/4
|
||||
rep stosd
|
||||
@ -2186,21 +2186,21 @@ fs_RamdiskSetFileEnd:
|
||||
@@:
|
||||
sub eax, 0x200
|
||||
jbe @f
|
||||
movzx ecx, word [0x280000+ecx*2]
|
||||
movzx ecx, word [RAMDISK_FAT+ecx*2]
|
||||
jmp @b
|
||||
@@:
|
||||
; zero data at the end of last sector
|
||||
push ecx
|
||||
mov edi, ecx
|
||||
shl edi, 9
|
||||
lea edi, [edi+0x100000+31*512+eax+0x200]
|
||||
lea edi, [edi+RAMDISK+31*512+eax+0x200]
|
||||
mov ecx, eax
|
||||
neg ecx
|
||||
xor eax, eax
|
||||
rep stosb
|
||||
pop ecx
|
||||
; terminate FAT chain
|
||||
lea ecx, [0x280000+ecx+ecx]
|
||||
lea ecx, [RAMDISK_FAT+ecx+ecx]
|
||||
push dword [ecx]
|
||||
mov word [ecx], 0xFFF
|
||||
pop ecx
|
||||
@ -2213,7 +2213,7 @@ fs_RamdiskSetFileEnd:
|
||||
; mark all clusters as free
|
||||
cmp ecx, 0xFF8
|
||||
jae .deleted
|
||||
lea ecx, [0x280000+ecx+ecx]
|
||||
lea ecx, [RAMDISK_FAT+ecx+ecx]
|
||||
push dword [ecx]
|
||||
and word [ecx], 0
|
||||
pop ecx
|
||||
@ -2334,7 +2334,7 @@ fs_RamdiskExecute:
|
||||
mov edx, [eax+4] ; cluster
|
||||
lea esi, [edx+31]
|
||||
shl esi, 9
|
||||
add esi, 0x100000
|
||||
add esi, RAMDISK
|
||||
mov ecx, 512/4
|
||||
rep movsd
|
||||
mov ecx, [eax]
|
||||
@ -2348,7 +2348,7 @@ fs_RamdiskExecute:
|
||||
pop eax
|
||||
@@:
|
||||
mov [eax], ecx
|
||||
mov dx, [edx*2+0x280000]
|
||||
mov dx, [edx*2+RAMDISK_FAT]
|
||||
mov [eax+4], dx ; high word is already zero
|
||||
popad
|
||||
xor eax, eax
|
||||
|
@ -333,7 +333,7 @@ if lang eq ru
|
||||
; End set VGA russian font
|
||||
else if lang eq et
|
||||
mov bp,ET_FNT-10000h ; ET_FNT1
|
||||
mov bx,1000h ;
|
||||
mov bx,1000h ;
|
||||
mov cx,255 ; 256 symbols
|
||||
mov dx,0h ; 0 - position of first symbol
|
||||
mov ax,1100h
|
||||
@ -835,7 +835,7 @@ else if lang eq et
|
||||
ja @f
|
||||
mov [time_str+9-0x10000], ' '
|
||||
mov [time_str+10-0x10000],' '
|
||||
@@:
|
||||
@@:
|
||||
else
|
||||
; wait 5/4/3/2 seconds, 1 second
|
||||
cmp al, 1
|
||||
@ -982,8 +982,8 @@ end if
|
||||
mov eax,[es:di+0x28]
|
||||
mov [es:0x9018],eax
|
||||
; ---- vbe voodoo
|
||||
BytesPerScanLine equ 0x10
|
||||
mov ax, [es:di+BytesPerScanLine]
|
||||
BytesPerLine equ 0x10
|
||||
mov ax, [es:di+BytesPerLine]
|
||||
mov [es:0x9001],ax
|
||||
; BPP
|
||||
mov al,byte [es:di+0x19]
|
||||
|
@ -82,13 +82,13 @@
|
||||
read_image:
|
||||
mov eax, hdsysimage
|
||||
mov ebx, 1474560/512
|
||||
mov ecx, 0x100000
|
||||
mov ecx, RAMDISK
|
||||
mov esi, 0
|
||||
mov edi, 12
|
||||
call file_read
|
||||
ret
|
||||
ret
|
||||
|
||||
image_retrieved db 0
|
||||
image_retrieved db 0
|
||||
counter_of_partitions db 0
|
||||
no_sys_on_hd:
|
||||
yes_sys_on_hd:
|
||||
|
@ -52,7 +52,7 @@ system_shutdown: ; shut down the system
|
||||
lea esi,[eax+220] ; x end
|
||||
sub eax,220 ; x start
|
||||
|
||||
mov ebx,[0xfe04]
|
||||
mov ebx,[ScreenHeight]
|
||||
shr ebx,1
|
||||
mov [shutdownpos],ebx
|
||||
lea ebp,[ebx+105] ; y end
|
||||
|
@ -146,21 +146,26 @@ TASK_EVENT equ (OS_BASE+0x0003020)
|
||||
|
||||
mouseunder equ (OS_BASE+0x0006900)
|
||||
FLOPPY_BUFF equ (OS_BASE+0x0008000)
|
||||
ACTIVE_PROC_STACK equ (OS_BASE+0x000A400)
|
||||
ACTIVE_PROC_STACK equ (OS_BASE+0x000A400) ;unused
|
||||
idts equ (OS_BASE+0x000B100)
|
||||
WIN_STACK equ (OS_BASE+0x000C000)
|
||||
WIN_POS equ (OS_BASE+0x000C400)
|
||||
FDD_BUFF equ (OS_BASE+0x000D000)
|
||||
FDD_DATA equ (OS_BASE+0x000D000)
|
||||
|
||||
;unused ? only one reference
|
||||
ENABLE_TASKSWITCH equ (OS_BASE+0x000E000)
|
||||
|
||||
PUTPIXEL equ (OS_BASE+0x000E020)
|
||||
GETPIXEL equ (OS_BASE+0x000E024)
|
||||
|
||||
;unused ? only one reference
|
||||
BANK_SWITCH equ (OS_BASE+0x000E030)
|
||||
|
||||
;unused ? store mousepointer
|
||||
MOUSE_PICTURE equ (OS_BASE+0x000F200)
|
||||
|
||||
MOUSE_VISIBLE equ (OS_BASE+0x000F204)
|
||||
XY_TEMP equ (OS_BASE+0x000F300)
|
||||
WIN_TEMP_XY equ (OS_BASE+0x000F300)
|
||||
KEY_COUNT equ (OS_BASE+0x000F400)
|
||||
KEY_BUFF equ (OS_BASE+0x000F401)
|
||||
|
||||
@ -168,9 +173,13 @@ BTN_COUNT equ (OS_BASE+0x000F500)
|
||||
BTN_BUFF equ (OS_BASE+0x000F501)
|
||||
|
||||
CPU_FREQ equ (OS_BASE+0x000F600)
|
||||
|
||||
;unused ? no active references
|
||||
MOUSE_PORT equ (OS_BASE+0x000F604)
|
||||
|
||||
;unused
|
||||
PS2_CHUNK equ (OS_BASE+0x000FB00)
|
||||
|
||||
MOUSE_X equ (OS_BASE+0x000FB0A)
|
||||
MOUSE_Y equ (OS_BASE+0x000FB0C)
|
||||
|
||||
@ -181,14 +190,17 @@ MOUSE_DOWN equ (OS_BASE+0x000FB44)
|
||||
X_UNDER equ (OS_BASE+0x000FB4A)
|
||||
Y_UNDER equ (OS_BASE+0x000FB4C)
|
||||
ScreenBPP equ (OS_BASE+0x000FBF1)
|
||||
|
||||
;unused ? only one reference
|
||||
MOUSE_BUFF_COUNT equ (OS_BASE+0x000FCFF)
|
||||
|
||||
LFBAddress equ (OS_BASE+0x000FE80)
|
||||
MEM_AMOUNT equ (OS_BASE+0x000FE8C)
|
||||
;LFBSize equ (OS_BASE+0x02f9050)
|
||||
|
||||
SCR_X_SIZE equ (OS_BASE+0x000FE00)
|
||||
SCR_Y_SIZE equ (OS_BASE+0x000FE04)
|
||||
SCR_BYTES_PER_LINE equ (OS_BASE+0x000FE08)
|
||||
ScreenWidth equ (OS_BASE+0x000FE00)
|
||||
ScreenHeight equ (OS_BASE+0x000FE04)
|
||||
BytesPerScanLine equ (OS_BASE+0x000FE08)
|
||||
SCR_MODE equ (OS_BASE+0x000FE0C)
|
||||
|
||||
BTN_ADDR equ (OS_BASE+0x000FE88)
|
||||
@ -201,12 +213,14 @@ MOUSE_BACKGROUND equ (OS_BASE+0x000FFF4)
|
||||
DONT_DRAW_MOUSE equ (OS_BASE+0x000FFF5)
|
||||
DONT_SWITCH equ (OS_BASE+0x000FFFF)
|
||||
|
||||
STACK_TOP equ (OS_BASE+0x003EC00)
|
||||
TMP_STACK_TOP equ 0x003EC00
|
||||
|
||||
FONT_II equ (OS_BASE+0x003EC00)
|
||||
FONT_I equ (OS_BASE+0x003F600)
|
||||
DISK_DATA equ (OS_BASE+0x0040000)
|
||||
DRIVE_DATA equ (OS_BASE+0x0040000)
|
||||
SLOT_BASE equ (OS_BASE+0x0080000)
|
||||
|
||||
;unused
|
||||
TMP_BUFF equ (OS_BASE+0x0090000)
|
||||
|
||||
VGABasePtr equ (OS_BASE+0x00A0000)
|
||||
@ -214,7 +228,10 @@ VGABasePtr equ (OS_BASE+0x00A0000)
|
||||
RAMDISK equ (OS_BASE+0x0100000)
|
||||
RAMDISK_FAT equ (OS_BASE+0x0280000)
|
||||
FLOPPY_FAT equ (OS_BASE+0x0282000)
|
||||
|
||||
; unused?
|
||||
SB16_Status equ (OS_BASE+0x02B0000)
|
||||
|
||||
BUTTON_INFO equ (OS_BASE+0x02C0000)
|
||||
RESERVED_PORTS equ (OS_BASE+0x02D0000)
|
||||
IRQ_SAVE equ (OS_BASE+0x02E0000)
|
||||
@ -222,7 +239,10 @@ SYS_VAR equ (OS_BASE+0x02f0000)
|
||||
IMG_BACKGROUND equ (OS_BASE+0x0300000)
|
||||
WinMapAddress equ (OS_BASE+0x0460000)
|
||||
display_data equ (OS_BASE+0x0460000)
|
||||
|
||||
;unused ?
|
||||
HD_CACHE equ (OS_BASE+0x0600000)
|
||||
|
||||
stack_data_start equ (OS_BASE+0x0700000)
|
||||
eth_data_start equ (OS_BASE+0x0700000)
|
||||
stack_data equ (OS_BASE+0x0704000)
|
||||
@ -230,7 +250,7 @@ stack_data_end equ (OS_BASE+0x071ffff)
|
||||
VMODE_BASE equ (OS_BASE+0x0760000)
|
||||
resendQ equ (OS_BASE+0x0770000)
|
||||
|
||||
;skin_data equ (OS_BASE+0x0778000)
|
||||
skin_data equ (OS_BASE+0x0778000)
|
||||
|
||||
|
||||
tss_data equ (OS_BASE+0x780000)
|
||||
|
@ -22,14 +22,14 @@ irq0:
|
||||
call updatecputimes
|
||||
.nocounter:
|
||||
|
||||
cmp [0xffff], byte 1
|
||||
cmp [DONT_SWITCH], byte 1
|
||||
jne .change_task
|
||||
|
||||
mov al,0x20 ; send End Of Interrupt signal
|
||||
mov dx,0x20
|
||||
out dx,al
|
||||
|
||||
mov [0xffff], byte 0
|
||||
mov [DONT_SWITCH], byte 0
|
||||
|
||||
restore_ring3_context
|
||||
iret
|
||||
@ -79,7 +79,7 @@ change_task:
|
||||
test eax, eax ; the same task -> skip switch
|
||||
jnz .return
|
||||
@@:
|
||||
mov [0xffff],byte 1
|
||||
mov [DONT_SWITCH],byte 1
|
||||
call do_change_task
|
||||
|
||||
.return:
|
||||
|
@ -361,7 +361,7 @@ irqhandler:
|
||||
shl esi,6 ; 1
|
||||
add esi,irq00read ; 1
|
||||
shl edi,12 ; 1
|
||||
add edi,0x2E0000
|
||||
add edi,IRQ_SAVE
|
||||
mov ecx,16
|
||||
|
||||
mov [check_idle_semaphore],5
|
||||
@ -461,8 +461,6 @@ clear_application_table_status:
|
||||
|
||||
ret
|
||||
|
||||
|
||||
|
||||
sys_resize_app_memory:
|
||||
; eax = 1 - resize
|
||||
; ebx = new amount of memory
|
||||
@ -477,84 +475,6 @@ sys_resize_app_memory:
|
||||
.no_application_mem_resize:
|
||||
ret
|
||||
|
||||
if 0
|
||||
get_app_params:
|
||||
|
||||
push eax
|
||||
|
||||
cmp [0x90000+6],word '00'
|
||||
jne no_00_header
|
||||
|
||||
mov eax,[0x90000+12]
|
||||
mov [app_start],eax
|
||||
mov eax,[0x90000+16]
|
||||
mov [app_i_end],eax
|
||||
mov eax,[0x90000+20]
|
||||
mov [app_mem],eax
|
||||
; \begin{diamond}[20.08.2006]
|
||||
; sanity check (functions 19,58 load app_i_end bytes and that must
|
||||
; fit in allocated memory to prevent kernel faults)
|
||||
cmp eax,[app_i_end]
|
||||
jb no_01_header
|
||||
; \end{diamond}[20.08.2006]
|
||||
shr eax,1
|
||||
sub eax,0x10
|
||||
mov [app_esp],eax
|
||||
mov eax,[0x90000+24]
|
||||
mov [app_i_param],eax
|
||||
mov [app_i_icon],dword 0
|
||||
|
||||
pop eax
|
||||
clc
|
||||
ret
|
||||
|
||||
no_00_header:
|
||||
|
||||
|
||||
cmp [0x90000+6],word '01'
|
||||
jne no_01_header
|
||||
|
||||
mov eax,[0x90000+12]
|
||||
mov [app_start],eax
|
||||
mov eax,[0x90000+16]
|
||||
mov [app_i_end],eax
|
||||
mov eax,[0x90000+20]
|
||||
mov [app_mem],eax
|
||||
; \begin{diamond}[20.08.2006]
|
||||
cmp eax,[app_i_end]
|
||||
jb no_01_header
|
||||
; \end{diamond}[20.08.2006]
|
||||
mov eax,[0x90000+24]
|
||||
mov [app_esp],eax
|
||||
mov eax,[0x90000+28]
|
||||
mov [app_i_param],eax
|
||||
mov eax,[0x90000+32]
|
||||
mov [app_i_icon],eax
|
||||
|
||||
pop eax
|
||||
clc
|
||||
ret
|
||||
|
||||
no_01_header:
|
||||
|
||||
pop eax
|
||||
stc
|
||||
ret
|
||||
|
||||
uglobal
|
||||
; new_process_place dd 0x0
|
||||
; app_start dd 0x0
|
||||
; app_i_end dd 0x0
|
||||
; app_mem dd 0x0
|
||||
; app_esp dd 0x0
|
||||
; app_i_param dd 0x0
|
||||
; app_i_icon dd 0x0
|
||||
; app_mem_pos dd 0x0
|
||||
endg
|
||||
|
||||
end if
|
||||
|
||||
|
||||
sys_threads:
|
||||
|
||||
; eax=1 create thread
|
||||
@ -637,8 +557,8 @@ term9:
|
||||
frstor [eax]
|
||||
@@:
|
||||
|
||||
mov [0xf400],byte 0 ; empty keyboard buffer
|
||||
mov [0xf500],byte 0 ; empty button buffer
|
||||
mov [KEY_COUNT],byte 0 ; empty keyboard buffer
|
||||
mov [BTN_COUNT],byte 0 ; empty button buffer
|
||||
|
||||
|
||||
; remove defined hotkeys
|
||||
@ -677,7 +597,7 @@ term9:
|
||||
|
||||
mov ecx,esi ; remove buttons
|
||||
bnewba2:
|
||||
mov edi,[0xfe88]
|
||||
mov edi,[BTN_ADDR]
|
||||
mov eax,edi
|
||||
cld
|
||||
movzx ebx,word [edi]
|
||||
@ -827,7 +747,7 @@ term9:
|
||||
|
||||
rmpr0:
|
||||
|
||||
mov esi,[0x2d0000]
|
||||
mov esi,[RESERVED_PORTS]
|
||||
|
||||
cmp esi,0
|
||||
je rmpr9
|
||||
@ -836,7 +756,7 @@ term9:
|
||||
|
||||
mov edi,esi
|
||||
shl edi,4
|
||||
add edi,0x2d0000
|
||||
add edi,RESERVED_PORTS
|
||||
|
||||
cmp edx,[edi]
|
||||
je rmpr4
|
||||
@ -857,7 +777,7 @@ term9:
|
||||
cld
|
||||
rep movsb
|
||||
|
||||
dec dword [0x2d0000]
|
||||
dec dword [RESERVED_PORTS]
|
||||
|
||||
jmp rmpr0
|
||||
|
||||
@ -898,8 +818,8 @@ term9:
|
||||
xor esi, esi
|
||||
call redrawscreen
|
||||
|
||||
mov [0xfff4],byte 0 ; no mouse background
|
||||
mov [0xfff5],byte 0 ; draw mouse
|
||||
mov [MOUSE_BACKGROUND],byte 0 ; no mouse background
|
||||
mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse
|
||||
|
||||
mov [application_table_status],0
|
||||
mov esi,process_terminated
|
||||
|
@ -284,6 +284,14 @@ test_app_header:
|
||||
mov ecx,[APP_HEADER_01.start]
|
||||
mov [ebx+0x08], ecx ;app_eip
|
||||
mov edx,[APP_HEADER_01.mem_size]
|
||||
|
||||
; \begin{diamond}[20.08.2006]
|
||||
; sanity check (functions 19,58 load app_i_end bytes and that must
|
||||
; fit in allocated memory to prevent kernel faults)
|
||||
cmp edx,[APP_HEADER_01.i_end]
|
||||
jb .fail
|
||||
; \end{diamond}[20.08.2006]
|
||||
|
||||
mov [ebx+0x10], edx ;app_mem
|
||||
mov ecx,[APP_HEADER_01.stack_top]
|
||||
mov [ebx+0x0C], ecx ;app_esp
|
||||
@ -1029,9 +1037,9 @@ proc set_app_params stdcall,slot:dword, params:dword,\
|
||||
|
||||
mov [ecx+0],dword 0
|
||||
mov [ecx+4],dword 0
|
||||
mov eax,[SCR_X_SIZE]
|
||||
mov eax,[ScreenWidth]
|
||||
mov [ecx+8],eax
|
||||
mov eax,[SCR_Y_SIZE]
|
||||
mov eax,[ScreenHeight]
|
||||
mov [ecx+12],eax
|
||||
|
||||
mov edi,[slot]
|
||||
|
@ -19,12 +19,12 @@ Detect_COM_Mouse:
|
||||
shl eax,2
|
||||
mov [irq_owner+eax],byte 1
|
||||
|
||||
inc dword [0x2d0000]
|
||||
mov edi,[0x2d0000]
|
||||
inc dword [RESERVED_PORTS]
|
||||
mov edi,[RESERVED_PORTS]
|
||||
shl edi,4
|
||||
mov [0x2d0000+edi+0],dword 1
|
||||
mov [0x2d0000+edi+4],dword 0x3f0
|
||||
mov [0x2d0000+edi+8],dword 0x3ff
|
||||
mov [RESERVED_PORTS+edi+0],dword 1
|
||||
mov [RESERVED_PORTS+edi+4],dword 0x3f0
|
||||
mov [RESERVED_PORTS+edi+8],dword 0x3ff
|
||||
|
||||
popa
|
||||
mov esi,boot_setmouse_type+22
|
||||
@ -33,20 +33,20 @@ Detect_COM_Mouse:
|
||||
sub [COMPortBaseAddr],100h
|
||||
call MSMouseSearch
|
||||
cmp AL,'M'
|
||||
jne @f
|
||||
jne @f
|
||||
mov [com2_mouse_detected],1
|
||||
pusha
|
||||
|
||||
mov eax,3
|
||||
shl eax,2
|
||||
mov [irq_owner+eax],byte 1
|
||||
|
||||
inc dword [0x2d0000]
|
||||
mov edi,[0x2d0000]
|
||||
|
||||
inc dword [RESERVED_PORTS]
|
||||
mov edi,[RESERVED_PORTS]
|
||||
shl edi,4
|
||||
mov [0x2d0000+edi+0],dword 1
|
||||
mov [0x2d0000+edi+4],dword 0x2f0
|
||||
mov [0x2d0000+edi+8],dword 0x2ff
|
||||
mov [RESERVED_PORTS+edi+0],dword 1
|
||||
mov [RESERVED_PORTS+edi+4],dword 0x2f0
|
||||
mov [RESERVED_PORTS+edi+8],dword 0x2ff
|
||||
|
||||
popa
|
||||
mov esi,boot_setmouse_type+44
|
||||
@ -77,14 +77,14 @@ MouseSearch:
|
||||
add DX,3
|
||||
mov AL,00000010b
|
||||
out DX,AL
|
||||
; Запретить все прерывания
|
||||
; Çàïðåòèòü âñå ïðåðûâàíè
|
||||
mov DX,[COMPortBaseAddr]
|
||||
inc DX
|
||||
mov AL,0
|
||||
out DX,AL
|
||||
; Проверить, что устройство подключено и является
|
||||
; Ïðîâåðèòü, ÷òî óñòðîéñòâî ïîäêëþ÷åíî è ÿâëÿåòñ
|
||||
; ìûøüþ òèïà MSMouse
|
||||
; Отключить питание мыши и прерывания
|
||||
; Îòêëþ÷èòü ïèòàíèå ìûøè è ïðåðûâàíè
|
||||
mov DX,[COMPortBaseAddr]
|
||||
add DX,4 ;ðåãèñòð óïðàâëåíèÿ ìîäåìîì
|
||||
mov AL,0 ;ñáðîñèòü DTR, RTS è OUT2
|
||||
@ -95,14 +95,14 @@ dT_1:
|
||||
dec ecx
|
||||
cmp ecx,0
|
||||
jne dT_1
|
||||
mov ecx,0xffff
|
||||
mov ecx,0xffff
|
||||
; Âêëþ÷èòü ïèòàíèå ìûøè
|
||||
mov AL,11b ;óñòàíîâèòü DTR è RTS
|
||||
out DX,AL
|
||||
; Очистить регистр данных
|
||||
; Î÷èñòèòü ðåãèñòð äàííûõ
|
||||
mov DX,[COMPortBaseAddr]
|
||||
in AL,DX
|
||||
; Цикл опроса порта
|
||||
; Öèêë îïðîñà ïîðòà
|
||||
WaitData:
|
||||
; Îæèäàòü åùå 10 "òèêîâ"
|
||||
dec ecx
|
||||
|
@ -4,8 +4,8 @@
|
||||
; àâòîð Mario79
|
||||
;***************************************************
|
||||
xor eax,eax
|
||||
mov edi,0x40000
|
||||
mov ecx,16384
|
||||
mov edi,DRIVE_DATA
|
||||
mov ecx,16384
|
||||
cld
|
||||
rep stosd
|
||||
|
||||
@ -17,4 +17,4 @@ wait_cmos:
|
||||
cmp cx,0
|
||||
jne wait_cmos
|
||||
in al,0x71
|
||||
mov [0x40000],al
|
||||
mov [DRIVE_DATA],al
|
||||
|
1381
kernel/trunk/drivers/ensoniq.asm
Normal file
1381
kernel/trunk/drivers/ensoniq.asm
Normal file
File diff suppressed because it is too large
Load Diff
@ -219,7 +219,7 @@ frfl7_1:
|
||||
frfl8_1:
|
||||
mov edi,[n_sector]
|
||||
shl edi,1 ;find next cluster from FAT
|
||||
add edi,0x282000
|
||||
add edi,FLOPPY_FAT
|
||||
mov eax,[edi]
|
||||
and eax,4095
|
||||
mov edi,eax
|
||||
@ -333,7 +333,7 @@ calculatefatchain_flp:
|
||||
pushad
|
||||
|
||||
mov esi,FLOPPY_BUFF
|
||||
mov edi,0x282000
|
||||
mov edi,FLOPPY_FAT
|
||||
|
||||
fcnew_1:
|
||||
mov eax,dword [esi]
|
||||
@ -361,7 +361,7 @@ calculatefatchain_flp:
|
||||
add edi,4
|
||||
add esi,12
|
||||
|
||||
cmp edi,0x282000+2856*2 ;2849 clusters
|
||||
cmp edi,FLOPPY_FAT+2856*2 ;2849 clusters
|
||||
jnz fcnew_1
|
||||
|
||||
popad
|
||||
@ -471,7 +471,7 @@ unnecessary_flp_fat_save:
|
||||
restorefatchain_flp: ; restore fat chain
|
||||
pushad
|
||||
|
||||
mov esi,0x282000
|
||||
mov esi,FLOPPY_FAT
|
||||
mov edi,FLOPPY_BUFF
|
||||
|
||||
fcnew2_1:
|
||||
@ -574,7 +574,7 @@ fifoundd_2_1:
|
||||
movzx edi, word [edi+0xf] ;edi = cluster
|
||||
frnewd_1:
|
||||
shl edi,1 ;find next cluster from FAT
|
||||
add edi,0x282000
|
||||
add edi,FLOPPY_FAT
|
||||
mov eax,[edi]
|
||||
mov [edi],word 0x0 ;clear fat chain cluster
|
||||
and eax,4095
|
||||
@ -783,7 +783,7 @@ frnewds_2:
|
||||
add ebx,1
|
||||
mov edi,ebx ; find free cluster in FAT
|
||||
shl edi,1
|
||||
add edi,0x282000
|
||||
add edi,FLOPPY_FAT
|
||||
mov eax,[edi]
|
||||
and eax,4095
|
||||
jnz frnewds_2
|
||||
@ -937,7 +937,7 @@ adr1_analyze_flp:
|
||||
|
||||
mov eax,[clust_tmp_flp]
|
||||
shl eax,1 ;find next cluster from FAT
|
||||
add eax,0x282000
|
||||
add eax,FLOPPY_FAT
|
||||
mov eax,[eax]
|
||||
and eax,4095
|
||||
cmp eax,0x0ff8
|
||||
@ -999,7 +999,7 @@ avanti:
|
||||
|
||||
mov eax,[clust_tmp_flp]
|
||||
shl eax,1 ;find next cluster from FAT
|
||||
add eax,0x282000
|
||||
add eax,FLOPPY_FAT
|
||||
mov eax,[eax]
|
||||
and eax,4095
|
||||
cmp eax,0x0ff8
|
||||
@ -1013,8 +1013,8 @@ avanti:
|
||||
|
||||
mov eax,[clust_tmp_flp]
|
||||
shl eax,1 ;find next cluster from FAT
|
||||
add eax,0x282000
|
||||
sub edi,0x282000
|
||||
add eax,FLOPPY_FAT
|
||||
sub edi,FLOPPY_FAT
|
||||
mov [eax],di
|
||||
|
||||
pusha
|
||||
@ -1061,7 +1061,7 @@ check_new_flp:
|
||||
add ebx,1
|
||||
mov edi,ebx ; find free cluster in FAT
|
||||
shl edi,1
|
||||
add edi,0x282000
|
||||
add edi,FLOPPY_FAT
|
||||
mov eax,[edi]
|
||||
and eax,4095
|
||||
cmp eax,0x0
|
||||
@ -1179,7 +1179,7 @@ flp_notroot_next_sector:
|
||||
pop [fd_prev_prev_sector]
|
||||
add ecx, 31
|
||||
mov [fd_prev_sector], ecx
|
||||
mov ecx, [(ecx-31)*2+0x282000]
|
||||
mov ecx, [(ecx-31)*2+FLOPPY_FAT]
|
||||
and ecx, 0xFFF
|
||||
cmp ecx, 2849
|
||||
jae flp_notroot_first.err2
|
||||
@ -1229,17 +1229,17 @@ flp_notroot_extend_dir:
|
||||
; find free cluster in FAT
|
||||
pusha
|
||||
xor eax, eax
|
||||
mov edi, 0x282000
|
||||
mov edi, FLOPPY_FAT
|
||||
mov ecx, 2849
|
||||
repnz scasw
|
||||
jnz .notfound
|
||||
mov word [edi-2], 0xFFF ; mark as last cluster
|
||||
sub edi, 0x282000
|
||||
sub edi, FLOPPY_FAT
|
||||
shr edi, 1
|
||||
dec edi
|
||||
mov eax, [esp+28]
|
||||
mov ecx, [eax]
|
||||
mov [0x282000+ecx*2], di
|
||||
mov [FLOPPY_FAT+ecx*2], di
|
||||
mov [eax], edi
|
||||
xor eax, eax
|
||||
mov edi, FDD_BUFF
|
||||
@ -1372,7 +1372,7 @@ fs_FloppyRead:
|
||||
pop ecx
|
||||
xor ebx, ebx
|
||||
.skip:
|
||||
movzx edi, word [edi*2+0x282000]
|
||||
movzx edi, word [edi*2+FLOPPY_FAT]
|
||||
jmp .new
|
||||
.done:
|
||||
mov ebx, edx
|
||||
@ -1468,7 +1468,7 @@ fs_FloppyReadFolder:
|
||||
jz .done
|
||||
jns @f
|
||||
; read next sector from FAT
|
||||
mov eax, [(eax-31-1)*2+0x282000]
|
||||
mov eax, [(eax-31-1)*2+FLOPPY_FAT]
|
||||
and eax, 0xFFF
|
||||
cmp eax, 0xFF8
|
||||
jae .done
|
||||
@ -1500,7 +1500,7 @@ fs_FloppyReadFolder:
|
||||
jz .done
|
||||
jns @f
|
||||
; read next sector from FAT
|
||||
mov eax, [(eax-31-1)*2+0x282000]
|
||||
mov eax, [(eax-31-1)*2+FLOPPY_FAT]
|
||||
and eax, 0xFFF
|
||||
cmp eax, 0xFF8
|
||||
jae .done
|
||||
@ -2195,7 +2195,7 @@ fs_FloppyWrite:
|
||||
jz .done
|
||||
.skip:
|
||||
.next_cluster:
|
||||
movzx edi, word [edi*2+0x282000]
|
||||
movzx edi, word [edi*2+FLOPPY_FAT]
|
||||
sub esi, 0x200
|
||||
jae @f
|
||||
xor esi, esi
|
||||
@ -2225,7 +2225,7 @@ floppy_extend_file:
|
||||
@@:
|
||||
sub ecx, 0x200
|
||||
jbe @f
|
||||
mov eax, [eax*2+0x282000]
|
||||
mov eax, [eax*2+FLOPPY_FAT]
|
||||
and eax, 0xFFF
|
||||
jz .fat_err
|
||||
cmp eax, 0xFF8
|
||||
@ -2238,7 +2238,7 @@ floppy_extend_file:
|
||||
ret
|
||||
@@:
|
||||
push eax
|
||||
mov eax, [eax*2+0x282000]
|
||||
mov eax, [eax*2+FLOPPY_FAT]
|
||||
and eax, 0xFFF
|
||||
cmp eax, 0xFF8
|
||||
pop eax
|
||||
@ -2249,7 +2249,7 @@ floppy_extend_file:
|
||||
pop ecx
|
||||
; now do extend
|
||||
push edx esi
|
||||
mov esi, 0x282000+2*2 ; start scan from cluster 2
|
||||
mov esi, FLOPPY_FAT+2*2 ; start scan from cluster 2
|
||||
mov edx, 2847 ; number of clusters to scan
|
||||
.extend_loop:
|
||||
cmp [edi+28], ecx
|
||||
@ -2269,12 +2269,12 @@ floppy_extend_file:
|
||||
mov word [edi-2], 0xFFF
|
||||
mov esi, edi
|
||||
mov edx, ecx
|
||||
sub edi, 0x282000
|
||||
sub edi, FLOPPY_FAT
|
||||
shr edi, 1
|
||||
dec edi ; now edi=new cluster
|
||||
test eax, eax
|
||||
jz .first_cluster
|
||||
mov [0x282000+eax*2], di
|
||||
mov [FLOPPY_FAT+eax*2], di
|
||||
jmp @f
|
||||
.first_cluster:
|
||||
pop eax ; eax->direntry
|
||||
@ -2429,7 +2429,7 @@ fs_FloppySetFileEnd:
|
||||
.next_cluster:
|
||||
sub dword [esp+12], 0x200
|
||||
jbe .expand_done
|
||||
movzx edi, word [0x282000+edi*2]
|
||||
movzx edi, word [FLOPPY_FAT+edi*2]
|
||||
jmp .zero_loop
|
||||
.expand_done:
|
||||
pop eax ecx ecx edi edi
|
||||
@ -2444,13 +2444,13 @@ fs_FloppySetFileEnd:
|
||||
@@:
|
||||
sub eax, 0x200
|
||||
jbe @f
|
||||
movzx ecx, word [0x282000+ecx*2]
|
||||
movzx ecx, word [FLOPPY_FAT+ecx*2]
|
||||
jmp @b
|
||||
@@:
|
||||
; we will zero data at the end of last sector - remember it
|
||||
push ecx
|
||||
; terminate FAT chain
|
||||
lea ecx, [0x282000+ecx+ecx]
|
||||
lea ecx, [FLOPPY_FAT+ecx+ecx]
|
||||
push dword [ecx]
|
||||
mov word [ecx], 0xFFF
|
||||
pop ecx
|
||||
@ -2464,7 +2464,7 @@ fs_FloppySetFileEnd:
|
||||
; mark all clusters as free
|
||||
cmp ecx, 0xFF8
|
||||
jae .deleted
|
||||
lea ecx, [0x282000+ecx+ecx]
|
||||
lea ecx, [FLOPPY_FAT+ecx+ecx]
|
||||
push dword [ecx]
|
||||
and word [ecx], 0
|
||||
pop ecx
|
||||
@ -2642,7 +2642,7 @@ fs_FloppyExecute:
|
||||
@@:
|
||||
mov [eax], ecx
|
||||
mov edx, [eax+4]
|
||||
mov dx, [edx*2+0x282000]
|
||||
mov dx, [edx*2+FLOPPY_FAT]
|
||||
mov [eax+4], dx ; high word is already zero
|
||||
popad
|
||||
xor eax, eax
|
||||
|
@ -579,7 +579,7 @@ LBA_read_ramdisk:
|
||||
mov esi,eax
|
||||
|
||||
shl esi,9
|
||||
add esi,0x100000
|
||||
add esi,RAMDISK
|
||||
mov ecx,512/4
|
||||
; cld
|
||||
rep movsd
|
||||
|
@ -552,30 +552,30 @@ fs_HasRamdisk:
|
||||
ret
|
||||
|
||||
fs_HasFloppy:
|
||||
cmp byte [0x40000], 0
|
||||
cmp byte [DRIVE_DATA], 0
|
||||
setnz al
|
||||
ret
|
||||
|
||||
fs_HasHd0:
|
||||
mov al, [0x40001]
|
||||
mov al, [DRIVE_DATA+1]
|
||||
and al, 11000000b
|
||||
cmp al, 01000000b
|
||||
setz al
|
||||
ret
|
||||
fs_HasHd1:
|
||||
mov al, [0x40001]
|
||||
mov al, [DRIVE_DATA+1]
|
||||
and al, 00110000b
|
||||
cmp al, 00010000b
|
||||
setz al
|
||||
ret
|
||||
fs_HasHd2:
|
||||
mov al, [0x40001]
|
||||
mov al, [DRIVE_DATA+1]
|
||||
and al, 00001100b
|
||||
cmp al, 00000100b
|
||||
setz al
|
||||
ret
|
||||
fs_HasHd3:
|
||||
mov al, [0x40001]
|
||||
mov al, [DRIVE_DATA+1]
|
||||
and al, 00000011b
|
||||
cmp al, 00000001b
|
||||
setz al
|
||||
@ -583,25 +583,25 @@ fs_HasHd3:
|
||||
|
||||
;*******************************************************
|
||||
fs_HasCd0:
|
||||
mov al, [0x40001]
|
||||
mov al, [DRIVE_DATA+1]
|
||||
and al, 11000000b
|
||||
cmp al, 10000000b
|
||||
setz al
|
||||
ret
|
||||
fs_HasCd1:
|
||||
mov al, [0x40001]
|
||||
mov al, [DRIVE_DATA+1]
|
||||
and al, 00110000b
|
||||
cmp al, 00100000b
|
||||
setz al
|
||||
ret
|
||||
fs_HasCd2:
|
||||
mov al, [0x40001]
|
||||
mov al, [DRIVE_DATA+1]
|
||||
and al, 00001100b
|
||||
cmp al, 00001000b
|
||||
setz al
|
||||
ret
|
||||
fs_HasCd3:
|
||||
mov al, [0x40001]
|
||||
mov al, [DRIVE_DATA+1]
|
||||
and al, 00000011b
|
||||
cmp al, 00000010b
|
||||
setz al
|
||||
@ -624,15 +624,15 @@ fs_NextRamdisk:
|
||||
ret
|
||||
|
||||
fs_NextFloppy:
|
||||
; we have /fd/1 iff (([0x40000] and 0xF0) != 0) and /fd/2 iff (([0x40000] and 0x0F) != 0)
|
||||
test byte [0x40000], 0xF0
|
||||
; we have /fd/1 iff (([DRIVE_DATA] and 0xF0) != 0) and /fd/2 iff (([DRIVE_DATA] and 0x0F) != 0)
|
||||
test byte [DRIVE_DATA], 0xF0
|
||||
jz .no1
|
||||
test eax, eax
|
||||
jnz .no1
|
||||
inc eax
|
||||
ret ; CF cleared
|
||||
.no1:
|
||||
test byte [0x40000], 0x0F
|
||||
test byte [DRIVE_DATA], 0x0F
|
||||
jz .no2
|
||||
cmp al, 2
|
||||
jae .no2
|
||||
@ -657,7 +657,7 @@ fs_NextHd3:
|
||||
push 3
|
||||
fs_NextHd:
|
||||
pop ecx
|
||||
movzx ecx, byte [0x40002+ecx]
|
||||
movzx ecx, byte [DRIVE_DATA+2+ecx]
|
||||
cmp eax, ecx
|
||||
jae fs_NextFloppy.no2
|
||||
inc eax
|
||||
|
@ -237,7 +237,7 @@ sys_button:
|
||||
|
||||
and ecx,0xffff
|
||||
|
||||
mov edi,[0xfe88]
|
||||
mov edi,[BTN_ADDR]
|
||||
movzx eax,word [edi]
|
||||
cmp eax,max_buttons
|
||||
jge noaddbutt
|
||||
@ -286,7 +286,7 @@ remove_button:
|
||||
|
||||
rnewba2:
|
||||
|
||||
mov edi,[0xfe88]
|
||||
mov edi,[BTN_ADDR]
|
||||
mov eax,edi
|
||||
movzx ebx,word [edi]
|
||||
inc bx
|
||||
@ -456,7 +456,7 @@ negativebutton:
|
||||
|
||||
checkbuttons:
|
||||
|
||||
cmp [0xfb40],byte 0 ; mouse buttons pressed
|
||||
cmp [BTN_DOWN],byte 0 ; mouse buttons pressed
|
||||
jnz @f
|
||||
ret
|
||||
@@:
|
||||
@ -464,7 +464,7 @@ checkbuttons:
|
||||
pushad
|
||||
|
||||
xor esi, esi
|
||||
mov edi, [0xfe88]
|
||||
mov edi, [BTN_ADDR]
|
||||
movzx edx, word [edi]
|
||||
test edx, edx
|
||||
jne @f
|
||||
@ -534,7 +534,7 @@ checkbuttons:
|
||||
mov ecx, [ebx+WDATA.box.left] ; window x start
|
||||
movzx edx,word [eax+4] ; button x start
|
||||
add edx,ecx
|
||||
mov cx,[0xfb0a]
|
||||
mov cx,[MOUSE_X]
|
||||
cmp edx,ecx
|
||||
jg buttonnewcheck
|
||||
|
||||
@ -550,7 +550,7 @@ checkbuttons:
|
||||
mov ecx, [ebx+WDATA.box.top] ; window y start
|
||||
movzx edx,word [eax+8] ; button y start
|
||||
add edx,ecx
|
||||
mov cx,[0xfb0c]
|
||||
mov cx,[MOUSE_Y]
|
||||
cmp edx,ecx
|
||||
jg buttonnewcheck
|
||||
|
||||
@ -569,7 +569,7 @@ checkbuttons:
|
||||
mov bx,[eax+2] ; button id : bits 00-16
|
||||
push ebx
|
||||
|
||||
mov [0xfb44],byte 1 ; no mouse down checks
|
||||
mov [MOUSE_DOWN],byte 1 ; no mouse down checks
|
||||
call find_pressed_button_frames
|
||||
call negativebutton
|
||||
|
||||
@ -584,13 +584,13 @@ checkbuttons:
|
||||
call stack_handler
|
||||
popad
|
||||
|
||||
cmp [0xfb40],byte 0 ; mouse buttons pressed ?
|
||||
cmp [BTN_DOWN],byte 0 ; mouse buttons pressed ?
|
||||
jnz cbwaitmouseup
|
||||
popad
|
||||
|
||||
call negativebutton
|
||||
mov [0xfff4],byte 0 ; no mouse background
|
||||
mov [0xfff5],byte 0 ; draw mouse
|
||||
mov [MOUSE_BACKGROUND],byte 0 ; no mouse background
|
||||
mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse
|
||||
;..................................... start 2/2 : modified by vhanla .............................
|
||||
; check coordinates
|
||||
jmp afterbuttonid
|
||||
@ -605,7 +605,7 @@ checkbuttons:
|
||||
mov ecx, [ebx+WDATA.box.left] ; window x start
|
||||
movzx edx,word [eax+4] ; button x start
|
||||
add edx,ecx
|
||||
mov cx,[0xfb0a]
|
||||
mov cx,[MOUSE_X]
|
||||
cmp edx,ecx
|
||||
jg no_on_button ;if we release the pointer out of the button area
|
||||
|
||||
@ -621,7 +621,7 @@ checkbuttons:
|
||||
mov ecx, [ebx+WDATA.box.top] ; window y start
|
||||
movzx edx,word [eax+8] ; button y start
|
||||
add edx,ecx
|
||||
mov cx,[0xfb0c]
|
||||
mov cx,[MOUSE_Y]
|
||||
cmp edx,ecx
|
||||
jg no_on_button
|
||||
|
||||
@ -630,16 +630,16 @@ checkbuttons:
|
||||
cmp ecx,edx
|
||||
jg no_on_button
|
||||
popa
|
||||
mov [0xf500],byte 1 ; no of buttons in buffer
|
||||
mov [BTN_COUNT],byte 1 ; no of buttons in buffer
|
||||
pop ebx
|
||||
mov [0xf501],ebx ; lets put the button id in buffer
|
||||
mov [BTN_BUFF],ebx ; lets put the button id in buffer
|
||||
push ebx
|
||||
pusha
|
||||
jmp yes_on_button
|
||||
no_on_button:
|
||||
mov [0xf500],byte 0 ; no of buttons in buffer
|
||||
mov [BTN_COUNT],byte 0 ; no of buttons in buffer
|
||||
yes_on_button:
|
||||
mov [0xfb44],byte 0 ; mouse down -> do not draw
|
||||
mov [MOUSE_DOWN],byte 0 ; mouse down -> do not draw
|
||||
popa
|
||||
pop ebx
|
||||
popa
|
||||
|
@ -530,7 +530,7 @@ get_event_for_app:
|
||||
mov eax, [TASK_COUNT]
|
||||
cmp eax,edx
|
||||
jne no_eventoccur2x
|
||||
cmp [0xf400],byte 0
|
||||
cmp [KEY_COUNT],byte 0
|
||||
je no_eventoccur2x
|
||||
eventoccur2:
|
||||
popad
|
||||
@ -549,7 +549,7 @@ get_event_for_app:
|
||||
;mov edi,[TASK_BASE] ; BUTTON IN BUFFER
|
||||
test [edi+TASKDATA.event_mask],dword 4
|
||||
jz no_eventoccur3
|
||||
cmp [0xf500],byte 0
|
||||
cmp [BTN_COUNT],byte 0
|
||||
je no_eventoccur3
|
||||
mov ecx, [CURRENT_TASK]
|
||||
movzx edx, word [WIN_STACK+ecx*2]
|
||||
@ -557,7 +557,7 @@ get_event_for_app:
|
||||
cmp eax,edx
|
||||
jnz no_eventoccur3
|
||||
popad
|
||||
mov eax,[0xf501]
|
||||
mov eax,[BTN_BUFF]
|
||||
cmp eax,65535
|
||||
je no_event_1
|
||||
mov eax,3
|
||||
@ -565,7 +565,7 @@ get_event_for_app:
|
||||
|
||||
no_event_1:
|
||||
mov [window_minimize],1
|
||||
mov [0xf500],byte 0
|
||||
mov [BTN_COUNT],byte 0
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
@ -589,7 +589,7 @@ get_event_for_app:
|
||||
;mov edi,[TASK_BASE] ; DESKTOP BACKGROUND REDRAW
|
||||
test [edi+TASKDATA.event_mask],dword 16
|
||||
jz no_eventoccur5
|
||||
cmp [0xfff0],byte 2
|
||||
cmp [REDRAW_BACKGROUND],byte 2
|
||||
jnz no_eventoccur5
|
||||
popad
|
||||
mov eax,5
|
||||
@ -647,7 +647,7 @@ get_event_for_app:
|
||||
cmp dword [edi+TASKDATA.event_mask], 0xFFFF
|
||||
jbe no_events
|
||||
|
||||
mov esi,0x2e0000 ; IRQ'S AND DATA
|
||||
mov esi,IRQ_SAVE ; IRQ'S AND DATA
|
||||
mov ebx,0x00010000
|
||||
xor ecx, ecx
|
||||
irq_event_test:
|
||||
|
@ -36,7 +36,7 @@ dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
|
||||
jnz .font2
|
||||
pushad
|
||||
mov esi, 9
|
||||
lea ebp, [0x3F600+8*edx+edx]
|
||||
lea ebp, [FONT_I+8*edx+edx]
|
||||
.symloop1:
|
||||
mov dl, byte [ebp]
|
||||
or dl, 1 shl 6
|
||||
@ -69,7 +69,7 @@ dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
|
||||
.font2:
|
||||
pushad
|
||||
add edx, edx
|
||||
lea ebp, [0x3EC00+4*edx+edx+1]
|
||||
lea ebp, [FONT_II+4*edx+edx+1]
|
||||
push 9
|
||||
movzx esi, byte [ebp-1]
|
||||
.symloop2:
|
||||
|
@ -1,6 +1,6 @@
|
||||
include "skindata.inc"
|
||||
|
||||
skin_data = 0x00778000
|
||||
;skin_data = 0x00778000
|
||||
|
||||
load_skin_file:
|
||||
; eax = filename
|
||||
@ -355,7 +355,7 @@ drawwindow_IV:
|
||||
jne no_skin_add_button
|
||||
|
||||
;* close button
|
||||
mov edi,[0xfe88]
|
||||
mov edi,[BTN_ADDR]
|
||||
movzx eax,word [edi]
|
||||
cmp eax,1000
|
||||
jge no_skin_add_button
|
||||
@ -394,7 +394,7 @@ drawwindow_IV:
|
||||
mov [eax],bx
|
||||
|
||||
;* minimize button
|
||||
mov edi,[0xfe88]
|
||||
mov edi,[BTN_ADDR]
|
||||
movzx eax,word [edi]
|
||||
cmp eax,1000
|
||||
jge no_skin_add_button
|
||||
|
@ -169,7 +169,7 @@ pushad
|
||||
inc edx
|
||||
|
||||
; get WinMap start
|
||||
mov edi, [0xFE00] ; screen_sx
|
||||
mov edi, [ScreenWidth] ; screen_sx
|
||||
inc edi
|
||||
imul edi, ebx
|
||||
add edi, eax
|
||||
@ -189,7 +189,7 @@ pushad
|
||||
|
||||
pop edx
|
||||
pop ecx
|
||||
add edi, [0xFE00]
|
||||
add edi, [ScreenWidth]
|
||||
inc edi
|
||||
sub edi, ecx
|
||||
dec edx
|
||||
@ -230,7 +230,7 @@ pushad
|
||||
|
||||
; get WinMap start -> ebp
|
||||
push eax
|
||||
mov eax, [0xFE00] ; screen_sx
|
||||
mov eax, [ScreenWidth] ; screen_sx
|
||||
inc eax
|
||||
imul eax, ebx
|
||||
add eax, [esp]
|
||||
@ -292,7 +292,7 @@ pushad
|
||||
jb .ff_new_x
|
||||
sub ebp, [ff_xsz]
|
||||
add ebp, [ff_x]
|
||||
add ebp, [0xFE00] ; screen.x
|
||||
add ebp, [ScreenWidth] ; screen.x
|
||||
inc ebp
|
||||
inc ebx
|
||||
cmp ebx, [ff_ysz]
|
||||
@ -349,9 +349,9 @@ display_settings:
|
||||
redraw_screen_direct:
|
||||
mov [dlx],dword 0
|
||||
mov [dly],dword 0
|
||||
mov eax,[0xfe00]
|
||||
mov eax,[ScreenWidth]
|
||||
mov [dlxe],eax
|
||||
mov eax,[0xfe04]
|
||||
mov eax,[ScreenHeight]
|
||||
mov [dlye],eax
|
||||
mov eax,window_data
|
||||
call redrawscreen
|
||||
@ -427,10 +427,10 @@ display_settings:
|
||||
movsx ebx,word[esp+16]
|
||||
cmp eax,ebx
|
||||
jge .lp1
|
||||
or eax,eax;[0xFE00]
|
||||
or eax,eax;[ScreenWidth]
|
||||
jl @f
|
||||
mov [screen_workarea.left],eax
|
||||
@@: cmp ebx,[0xFE00]
|
||||
@@: cmp ebx,[ScreenWidth]
|
||||
jg .lp1
|
||||
mov [screen_workarea.right],ebx
|
||||
.lp1: movsx eax,word[esp+24+2]
|
||||
@ -440,14 +440,14 @@ display_settings:
|
||||
or eax,eax;[0xFE04]
|
||||
jl @f
|
||||
mov [screen_workarea.top],eax
|
||||
@@: cmp ebx,[0xFE04]
|
||||
@@: cmp ebx,[ScreenHeight]
|
||||
jg .lp2
|
||||
mov [screen_workarea.bottom],ebx
|
||||
.lp2: call repos_windows
|
||||
mov eax, 0
|
||||
mov ebx, 0
|
||||
mov ecx, [0xfe00]
|
||||
mov edx, [0xfe04]
|
||||
mov ecx, [ScreenWidth]
|
||||
mov edx, [ScreenHeight]
|
||||
call calculatescreen
|
||||
; jmp redraw_screen_direct
|
||||
.exit:
|
||||
@ -498,8 +498,8 @@ display_settings:
|
||||
pushad
|
||||
mov eax, 0
|
||||
mov ebx, 0
|
||||
mov ecx, [0xfe00]
|
||||
mov edx, [0xfe04]
|
||||
mov ecx, [ScreenWidth]
|
||||
mov edx, [ScreenHeight]
|
||||
call calculatescreen
|
||||
popad
|
||||
mov dword[esp+32+36],0
|
||||
@ -517,7 +517,7 @@ display_settings:
|
||||
repos_windows:
|
||||
mov ecx,[TASK_COUNT]
|
||||
mov edi,0x20*2
|
||||
mov byte[0x0000fff0],1
|
||||
mov byte[REDRAW_BACKGROUND],1
|
||||
dec ecx
|
||||
jge @f
|
||||
ret
|
||||
@ -543,7 +543,7 @@ repos_windows:
|
||||
ret
|
||||
.lp2: mov eax,[edi+WDATA.box.left]
|
||||
add eax,[edi+WDATA.box.width]
|
||||
mov ebx,[0x0000fe00]
|
||||
mov ebx,[ScreenWidth]
|
||||
; inc ebx
|
||||
cmp eax,ebx
|
||||
jle .lp4
|
||||
@ -555,7 +555,7 @@ repos_windows:
|
||||
mov [edi+WDATA.box.left],ebx
|
||||
.lp4: mov eax,[edi+WDATA.box.top]
|
||||
add eax,[edi+WDATA.box.height]
|
||||
mov ebx,[0x0000fe04]
|
||||
mov ebx,[ScreenHeight]
|
||||
; inc ebx
|
||||
cmp eax,ebx
|
||||
jle .lp6
|
||||
@ -586,7 +586,7 @@ check_window_position:
|
||||
|
||||
mov esi,ecx ; check x pos
|
||||
add esi,eax
|
||||
cmp esi,[0xfe00]
|
||||
cmp esi,[ScreenWidth]
|
||||
jbe x_pos_ok
|
||||
mov [edi+WDATA.box.left],dword 0
|
||||
xor eax, eax
|
||||
@ -594,7 +594,7 @@ check_window_position:
|
||||
|
||||
mov esi,edx ; check y pos
|
||||
add esi,ebx
|
||||
cmp esi,[0xfe04]
|
||||
cmp esi,[ScreenHeight]
|
||||
jbe y_pos_ok
|
||||
mov [edi+WDATA.box.top],dword 0
|
||||
mov ebx,0
|
||||
@ -602,17 +602,17 @@ check_window_position:
|
||||
|
||||
mov esi,ecx ; check x size
|
||||
add esi,eax
|
||||
cmp esi,[0xfe00]
|
||||
cmp esi,[ScreenWidth]
|
||||
jbe x_size_ok
|
||||
mov ecx,[0xfe00]
|
||||
mov ecx,[ScreenWidth]
|
||||
mov [edi+WDATA.box.width],ecx
|
||||
x_size_ok:
|
||||
|
||||
mov esi,edx ; check y size
|
||||
add esi,ebx
|
||||
cmp esi,[0xfe04]
|
||||
cmp esi,[ScreenHeight]
|
||||
jbe y_size_ok
|
||||
mov edx,[0xfe04]
|
||||
mov edx,[ScreenHeight]
|
||||
mov [edi+WDATA.box.height],edx
|
||||
y_size_ok:
|
||||
|
||||
@ -634,8 +634,8 @@ sys_window_mouse:
|
||||
cmp [new_window_starting],eax
|
||||
jb swml1
|
||||
|
||||
mov [0xfff4],byte 0 ; no mouse background
|
||||
mov [0xfff5],byte 0 ; draw mouse
|
||||
mov [MOUSE_BACKGROUND],byte 0 ; no mouse background
|
||||
mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse
|
||||
|
||||
mov [new_window_starting],eax
|
||||
|
||||
@ -958,8 +958,8 @@ windowactivate:
|
||||
mov [ebx*2 + WIN_POS], si
|
||||
jmp waloop2
|
||||
wacont2:
|
||||
mov [0xf400], byte 0 ; empty keyboard buffer
|
||||
mov [0xf500], byte 0 ; empty button buffer
|
||||
mov [KEY_COUNT], byte 0 ; empty keyboard buffer
|
||||
mov [BTN_COUNT], byte 0 ; empty button buffer
|
||||
popad
|
||||
ret
|
||||
|
||||
@ -1053,7 +1053,7 @@ waredraw: ; if redraw necessary at activate
|
||||
jz .do_not_draw
|
||||
|
||||
popad
|
||||
mov [0xfb44], byte 1 ; do draw mouse
|
||||
mov [MOUSE_DOWN], byte 1 ; do draw mouse
|
||||
call windowactivate
|
||||
|
||||
; update screen info
|
||||
@ -1078,7 +1078,7 @@ waredraw: ; if redraw necessary at activate
|
||||
popad
|
||||
|
||||
mov [edi + WDATA.fl_redraw], 1 ; redraw flag for app
|
||||
mov [0xfb44],byte 0 ; mouse down checks
|
||||
mov [MOUSE_DOWN],byte 0 ; mouse down checks
|
||||
|
||||
ret
|
||||
|
||||
@ -1087,9 +1087,9 @@ waredraw: ; if redraw necessary at activate
|
||||
popad
|
||||
|
||||
call windowactivate
|
||||
mov [0xfb44],byte 0 ; mouse down checks
|
||||
mov [0xfff4],byte 0 ; no mouse background
|
||||
mov [0xfff5],byte 0 ; draw mouse
|
||||
mov [MOUSE_DOWN],byte 0 ; mouse down checks
|
||||
mov [MOUSE_BACKGROUND],byte 0 ; no mouse background
|
||||
mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse
|
||||
ret
|
||||
|
||||
|
||||
@ -1156,7 +1156,7 @@ restore_minimized_window:
|
||||
add edx, [edi+WDATA.box.height]
|
||||
call calculatescreen
|
||||
.done:
|
||||
mov [0xfff4],byte 0 ; no mouse under
|
||||
mov [MOUSE_BACKGROUND],byte 0 ; no mouse under
|
||||
.skip_redrawings:
|
||||
popfd
|
||||
ret
|
||||
@ -1186,7 +1186,7 @@ checkwindows:
|
||||
.continue:
|
||||
.no_minimizing:
|
||||
|
||||
cmp [0xfb40],byte 0 ; mouse buttons pressed ?
|
||||
cmp [BTN_DOWN],byte 0 ; mouse buttons pressed ?
|
||||
jne .mouse_buttons_pressed
|
||||
popad
|
||||
ret
|
||||
@ -1212,8 +1212,8 @@ checkwindows:
|
||||
test [edi+WDATA.fl_wstate],WSTATE_MINIMIZED
|
||||
jnz cwloop
|
||||
|
||||
movzx eax, word [0xfb0a]
|
||||
movzx ebx, word [0xfb0c]
|
||||
movzx eax, word [MOUSE_X]
|
||||
movzx ebx, word [MOUSE_Y]
|
||||
|
||||
cmp ecx, eax
|
||||
jae cwloop
|
||||
@ -1292,7 +1292,7 @@ checkwindows:
|
||||
mov [latest_window_touch], ecx
|
||||
mov [latest_window_touch_delta], edx
|
||||
|
||||
mov cl, [0xfb40] ; save for shade check
|
||||
mov cl, [BTN_DOWN] ; save for shade check
|
||||
mov [do_resize], cl
|
||||
no_emulation_righ_button:
|
||||
mov ecx, [edi + WDATA.box.left]
|
||||
@ -1312,8 +1312,8 @@ checkwindows:
|
||||
sub eax, ecx
|
||||
sub ebx, edx
|
||||
|
||||
mov esi, [0xfb0a]
|
||||
mov [0xf300], esi
|
||||
mov esi, [MOUSE_X]
|
||||
mov [WIN_TEMP_XY], esi
|
||||
|
||||
pushad ; wait for putimages to finish
|
||||
; mov eax,5
|
||||
@ -1340,19 +1340,19 @@ checkwindows:
|
||||
call drawwindowframes
|
||||
|
||||
mov [reposition],0
|
||||
mov [0xfb44],byte 1 ; no reaction to mouse up/down
|
||||
mov [MOUSE_DOWN],byte 1 ; no reaction to mouse up/down
|
||||
|
||||
; move window
|
||||
|
||||
newchm:
|
||||
|
||||
mov [0xfff5],byte 1
|
||||
mov [DONT_DRAW_MOUSE],byte 1
|
||||
|
||||
call checkidle
|
||||
|
||||
call checkVga_N13
|
||||
|
||||
mov [0xfff4],byte 0
|
||||
mov [MOUSE_BACKGROUND],byte 0
|
||||
|
||||
call [draw_pointer]
|
||||
|
||||
@ -1360,12 +1360,12 @@ checkwindows:
|
||||
call stack_handler
|
||||
popad
|
||||
|
||||
mov esi,[0xf300]
|
||||
cmp esi,[0xfb0a]
|
||||
mov esi,[WIN_TEMP_XY]
|
||||
cmp esi,[MOUSE_X]
|
||||
je cwb
|
||||
|
||||
mov cx,[0xfb0a]
|
||||
mov dx,[0xfb0c]
|
||||
mov cx,[MOUSE_X]
|
||||
mov dx,[MOUSE_Y]
|
||||
sub cx,ax
|
||||
sub dx,bx
|
||||
|
||||
@ -1374,8 +1374,8 @@ checkwindows:
|
||||
|
||||
call drawwindowframes
|
||||
|
||||
mov ax,[0xfe00]
|
||||
mov bx,[0xfe04]
|
||||
mov ax,[ScreenWidth]
|
||||
mov bx,[ScreenHeight]
|
||||
|
||||
cmp [do_resize_from_corner],1
|
||||
je no_new_position
|
||||
@ -1415,7 +1415,7 @@ checkwindows:
|
||||
;add edx,0x80000 ; process base at 0x80000+
|
||||
lea edx, [SLOT_BASE + edx*8]
|
||||
|
||||
movzx eax,word [0xfb0a]
|
||||
movzx eax,word [MOUSE_X]
|
||||
cmp eax,[edi + WDATA.box.left]
|
||||
jb nnepx
|
||||
sub eax,[edi + WDATA.box.left]
|
||||
@ -1428,7 +1428,7 @@ checkwindows:
|
||||
|
||||
call get_rolledup_height
|
||||
mov ebx,eax
|
||||
movzx eax,word [0xfb0c]
|
||||
movzx eax,word [MOUSE_Y]
|
||||
cmp eax,[edi + WDATA.box.top]
|
||||
jb nnepy
|
||||
sub eax,[edi + WDATA.box.top]
|
||||
@ -1448,14 +1448,14 @@ checkwindows:
|
||||
pop ax
|
||||
call drawwindowframes
|
||||
|
||||
mov esi,[0xfb0a]
|
||||
mov [0xf300],esi
|
||||
mov esi,[MOUSE_X]
|
||||
mov [WIN_TEMP_XY],esi
|
||||
|
||||
cwb:
|
||||
cmp [0xfb40],byte 0
|
||||
cmp [BTN_DOWN],byte 0
|
||||
jne newchm
|
||||
; new position done
|
||||
mov [0xfff5],byte 1
|
||||
mov [DONT_DRAW_MOUSE],byte 1
|
||||
mov cl,0
|
||||
test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
|
||||
jnz @f
|
||||
@ -1566,16 +1566,16 @@ checkwindows:
|
||||
|
||||
mov eax,[edi+WDATA.box.top] ; check Y inside screen
|
||||
add eax,[edi+WDATA.box.height]
|
||||
cmp eax,[0xfe04]
|
||||
cmp eax,[ScreenHeight]
|
||||
jbe no_window_sizing
|
||||
mov eax,[edi+WDATA.box.left] ; check X inside screen
|
||||
add eax,[edi+WDATA.box.width]
|
||||
cmp eax,[0xfe00]
|
||||
cmp eax,[ScreenWidth]
|
||||
jbe no_window_sizing
|
||||
mov eax,[0xfe00]
|
||||
mov eax,[ScreenWidth]
|
||||
sub eax,[edi+WDATA.box.width]
|
||||
mov [edi+WDATA.box.left],eax
|
||||
mov eax,[0xfe04]
|
||||
mov eax,[ScreenHeight]
|
||||
sub eax,[edi+WDATA.box.height]
|
||||
mov [edi+WDATA.box.top],eax
|
||||
call set_window_clientbox
|
||||
@ -1586,7 +1586,7 @@ checkwindows:
|
||||
cmp [reposition],0
|
||||
je retwm
|
||||
|
||||
mov [0xfff5],byte 1 ; no mouse
|
||||
mov [DONT_DRAW_MOUSE],byte 1 ; no mouse
|
||||
|
||||
|
||||
push eax ebx ecx edx
|
||||
@ -1615,7 +1615,7 @@ checkwindows:
|
||||
|
||||
mov ecx,100 ; wait to avoid mouse residuals
|
||||
waitre2:
|
||||
mov [0xfff5],byte 1
|
||||
mov [DONT_DRAW_MOUSE],byte 1
|
||||
call checkidle
|
||||
cmp [edi+WDATA.fl_redraw],0
|
||||
jz retwm
|
||||
@ -1623,9 +1623,9 @@ checkwindows:
|
||||
|
||||
retwm:
|
||||
|
||||
mov [0xfff5],byte 0 ; mouse pointer
|
||||
mov [0xfff4],byte 0 ; no mouse under
|
||||
mov [0xfb44],byte 0 ; react to mouse up/down
|
||||
mov [DONT_DRAW_MOUSE],byte 0 ; mouse pointer
|
||||
mov [MOUSE_BACKGROUND],byte 0 ; no mouse under
|
||||
mov [MOUSE_DOWN],byte 0 ; react to mouse up/down
|
||||
|
||||
mov esi,window_moved
|
||||
call sys_msg_board_str
|
||||
|
@ -267,12 +267,12 @@ irq1:
|
||||
.scancode:
|
||||
mov bl, ch
|
||||
.dowrite:
|
||||
movzx eax,byte[0xF400]
|
||||
movzx eax,byte[KEY_COUNT]
|
||||
cmp al,120
|
||||
jae .exit.irq1
|
||||
inc eax
|
||||
mov [0xF400],al
|
||||
mov [0xF400+eax],bl
|
||||
mov [KEY_COUNT],al
|
||||
mov [KEY_COUNT+eax],bl
|
||||
|
||||
.exit.irq1:
|
||||
mov [check_idle_semaphore],5
|
||||
|
@ -61,7 +61,7 @@ check_mouse_data_com1:
|
||||
shr ah,5
|
||||
and ah,1
|
||||
add al,ah
|
||||
mov [0xfb40],al
|
||||
mov [BTN_DOWN],al
|
||||
mov [mouse_active],1
|
||||
; Прибавить перемещение по X к координате X
|
||||
mov AL,[FirstByte]
|
||||
@ -69,21 +69,21 @@ check_mouse_data_com1:
|
||||
or AL,[SecondByte]
|
||||
cbw
|
||||
call mouse_acceleration_com1
|
||||
add AX,[0xFB0A] ;[XCoordinate]
|
||||
add AX,[MOUSE_X] ;[XCoordinate]
|
||||
; Курсор не должен выходить за левую или
|
||||
; правую границу экрана
|
||||
js @@X1
|
||||
cmp AX,[0xFE00] ;ScreenLength
|
||||
cmp AX,[ScreenWidth] ;ScreenLength
|
||||
jb @@X2
|
||||
; Установить координату X по правой границе
|
||||
mov AX,[0xFE00] ;ScreenLength-1
|
||||
mov AX,[ScreenWidth] ;ScreenLength-1
|
||||
dec ax
|
||||
jmp @@X2
|
||||
@@X1:
|
||||
; Установить координату X по левой границе
|
||||
xor AX,AX
|
||||
@@X2:
|
||||
mov [0xFB0A],AX ;[XCoordinate]
|
||||
mov [MOUSE_X],AX ;[XCoordinate]
|
||||
; Прибавить перемещение по Y к координате Y
|
||||
mov AL,[FirstByte]
|
||||
and AL,00001100b
|
||||
@ -91,21 +91,21 @@ check_mouse_data_com1:
|
||||
or AL,[ThirdByte]
|
||||
cbw
|
||||
call mouse_acceleration_com1
|
||||
add AX,[0xFB0C] ;[YCoordinate]
|
||||
add AX,[MOUSE_Y] ;[YCoordinate]
|
||||
; Курсор не должен выходить за верхнюю или
|
||||
; нижнюю границу экрана
|
||||
js @@Y1
|
||||
cmp AX,[0xFE04] ;ScreenHeigth
|
||||
cmp AX,[ScreenHeight] ;ScreenHeigth
|
||||
jb @@Y2
|
||||
; Установить координату X по нижней границе
|
||||
mov AX,[0xFE04] ;ScreenHeigth-1
|
||||
mov AX,[ScreenHeight] ;ScreenHeigth-1
|
||||
dec ax
|
||||
jmp @@Y2
|
||||
@@Y1:
|
||||
; Установить координату X по верхней границе
|
||||
xor AX,AX
|
||||
@@Y2:
|
||||
mov [0xFB0C],AX ;[YCoordinate]
|
||||
mov [MOUSE_Y],AX ;[YCoordinate]
|
||||
mov eax,[timer_ticks]
|
||||
mov [timer_ticks_com],eax
|
||||
jmp @@EndMouseInterrupt
|
||||
|
@ -61,7 +61,7 @@ check_mouse_data_com2:
|
||||
shr ah,5
|
||||
and ah,1
|
||||
add al,ah
|
||||
mov [0xfb40],al
|
||||
mov [BTN_DOWN],al
|
||||
mov [mouse_active],1
|
||||
; Прибавить перемещение по X к координате X
|
||||
mov AL,[FirstByte_1]
|
||||
@ -69,21 +69,21 @@ check_mouse_data_com2:
|
||||
or AL,[SecondByte_1]
|
||||
cbw
|
||||
call mouse_acceleration_com2
|
||||
add AX,[0xFB0A] ;[XCoordinate]
|
||||
add AX,[MOUSE_X] ;[XCoordinate]
|
||||
; Курсор не должен выходить за левую или
|
||||
; правую границу экрана
|
||||
js @@X1_1
|
||||
cmp AX,[0xFE00] ;ScreenLength
|
||||
cmp AX,[ScreenWidth] ;ScreenLength
|
||||
jb @@X2_1
|
||||
; Установить координату X по правой границе
|
||||
mov AX,[0xFE00] ;ScreenLength-1
|
||||
mov AX,[ScreenWidth] ;ScreenLength-1
|
||||
dec ax
|
||||
jmp @@X2_1
|
||||
@@X1_1:
|
||||
; Установить координату X по левой границе
|
||||
xor AX,AX
|
||||
@@X2_1:
|
||||
mov [0xFB0A],AX ;[XCoordinate]
|
||||
mov [MOUSE_X],AX ;[XCoordinate]
|
||||
; Прибавить перемещение по Y к координате Y
|
||||
mov AL,[FirstByte_1]
|
||||
and AL,00001100b
|
||||
@ -91,21 +91,21 @@ check_mouse_data_com2:
|
||||
or AL,[ThirdByte_1]
|
||||
cbw
|
||||
call mouse_acceleration_com2
|
||||
add AX,[0xFB0C] ;[YCoordinate]
|
||||
add AX,[MOUSE_Y] ;[YCoordinate]
|
||||
; Курсор не должен выходить за верхнюю или
|
||||
; нижнюю границу экрана
|
||||
js @@Y1_1
|
||||
cmp AX,[0xFE04] ;ScreenHeigth
|
||||
cmp AX,[ScreenHeight] ;ScreenHeigth
|
||||
jb @@Y2_1
|
||||
; Установить координату X по нижней границе
|
||||
mov AX,[0xFE04] ;ScreenHeigth-1
|
||||
mov AX,[ScreenHeight] ;ScreenHeigth-1
|
||||
dec ax
|
||||
jmp @@Y2_1
|
||||
@@Y1_1:
|
||||
; Установить координату X по верхней границе
|
||||
xor AX,AX
|
||||
@@Y2_1:
|
||||
mov [0xFB0C],AX ;[YCoordinate]
|
||||
mov [MOUSE_Y],AX ;[YCoordinate]
|
||||
mov eax,[timer_ticks]
|
||||
mov [timer_ticks_com_1],eax
|
||||
jmp @@EndMouseInterrupt_1
|
||||
|
@ -42,13 +42,13 @@ check_mouse_data_ps2:
|
||||
; Записать новое значение байта состояния кнопок
|
||||
mov al,[FirstByte_2] ;[0xfb01]
|
||||
and eax,3
|
||||
mov [0xfb40],al
|
||||
mov [BTN_DOWN],al
|
||||
mov [mouse_active],1
|
||||
; Вычислить новую X-координату курсора
|
||||
; Занести в AX перемещение по X
|
||||
mov AH,0 ;дублируем знак во все разряды AH
|
||||
mov AL,[FirstByte_2]
|
||||
test AL,10000b
|
||||
test AL,10000b
|
||||
jz @@M0
|
||||
mov AH,0FFh
|
||||
; Занести в AL младший байт
|
||||
@ -57,18 +57,18 @@ check_mouse_data_ps2:
|
||||
call mouse_acceleration_ps2
|
||||
; Вычислить новое значение координаты
|
||||
; курсора по X
|
||||
add AX,[0xFB0A] ;[XCoordinate]
|
||||
add AX,[MOUSE_X] ;[XCoordinate]
|
||||
cmp AX,0
|
||||
jge @@M1
|
||||
mov AX,0
|
||||
jmp @@M2
|
||||
@@M1:
|
||||
cmp AX,[0xFE00] ;ScreenLength
|
||||
cmp AX,[ScreenWidth] ;ScreenLength
|
||||
jl @@M2
|
||||
mov AX,[0xFE00] ;ScreenLength-1
|
||||
mov AX,[ScreenWidth] ;ScreenLength-1
|
||||
dec ax
|
||||
@@M2:
|
||||
mov [0xFB0A],AX ;[XCoordinate]
|
||||
mov [MOUSE_X],AX ;[XCoordinate]
|
||||
|
||||
; Вычисляем новую Y-координату курсора
|
||||
; Занести в AX перемещение по Y
|
||||
@ -84,19 +84,19 @@ check_mouse_data_ps2:
|
||||
; Вычислить новое значение координаты курсора
|
||||
; по Y (Y-координата мыши PS/2 направлена
|
||||
; противоположно экранной)
|
||||
neg AX
|
||||
add AX,[0xFB0C] ;[YCoordinate]
|
||||
neg AX
|
||||
add AX,[MOUSE_Y] ;[YCoordinate]
|
||||
cmp AX,0
|
||||
jge @@M4
|
||||
mov AX,0
|
||||
jmp @@M5
|
||||
@@M4:
|
||||
cmp AX,[0xFE04] ;ScreenHeigth
|
||||
cmp AX,[ScreenHeight] ;ScreenHeigth
|
||||
jl @@M5
|
||||
mov AX,[0xFE04] ;ScreenHeigth-1
|
||||
mov AX,[ScreenHeight] ;ScreenHeigth-1
|
||||
dec ax
|
||||
@@M5:
|
||||
mov [0xFB0C],AX ;[YCoordinate]
|
||||
mov [MOUSE_Y],AX ;[YCoordinate]
|
||||
|
||||
; Показать курсор в новой позиции
|
||||
mov eax,[timer_ticks]
|
||||
@ -106,7 +106,7 @@ check_mouse_data_ps2:
|
||||
; Обнаружен сбой в порядке передачи информации от мыши
|
||||
@@Error_2:
|
||||
mov [MouseByteNumber_2],0
|
||||
; Íîðìàëüíîå çàâåðøåíèå ïðåðûâàíèÿ
|
||||
; Íîðìàëüíîå çàâåðøåíèå ïðåðûâàíè
|
||||
@@EndMouseInterrupt_2:
|
||||
call ready_for_next_irq_1
|
||||
ret
|
||||
@ -129,7 +129,7 @@ mouse_acceleration_ps2:
|
||||
;***********************************************
|
||||
Wait8042BufferEmpty:
|
||||
; push CX
|
||||
; mov CX,0FFFFh ;çàäàòü ÷èñëî öèêëîâ îæèäàíèÿ
|
||||
; mov CX,0FFFFh ;çàäàòü ÷èñëî öèêëîâ îæèäàíè
|
||||
;@@kb:
|
||||
; in AL,64h ;получить статус
|
||||
; test AL,10b ;буфер i8042 свободен?
|
||||
@ -138,7 +138,7 @@ Wait8042BufferEmpty:
|
||||
push ecx
|
||||
xor ecx,ecx
|
||||
@@:
|
||||
in al,64h
|
||||
in al,64h
|
||||
test al,00000010b
|
||||
loopnz @b
|
||||
pop ecx
|
||||
@ -150,8 +150,8 @@ Wait8042BufferEmpty:
|
||||
;* ОЖИДАНИЕ ПОСТУПЛЕНИЯ ДАННЫХ ОТ МЫШИ *
|
||||
;***************************************
|
||||
WaitMouseData:
|
||||
; push CX
|
||||
; mov CX,0FFFFh ;çàäàòü ÷èñëî öèêëîâ îæèäàíèÿ
|
||||
; push CX
|
||||
; mov CX,0FFFFh ;çàäàòü ÷èñëî öèêëîâ îæèäàíè
|
||||
;@@mouse:
|
||||
; in AL,64h ;опросить регистр статуса
|
||||
; test AL,100000b ;данные поступили?
|
||||
@ -160,11 +160,11 @@ WaitMouseData:
|
||||
push ecx
|
||||
mov ECX,0FFFFh
|
||||
@@:
|
||||
in al,64h
|
||||
in al,64h
|
||||
test al,100000b
|
||||
loopz @b
|
||||
pop ecx
|
||||
;Если при выходе из подпрограммы установлен
|
||||
;флаг ZF - ошибка
|
||||
ret
|
||||
ret
|
||||
|
||||
|
@ -43,8 +43,8 @@ draw_mouse_under:
|
||||
cmp [set_hw_cursor], 0
|
||||
jz @F
|
||||
pushad
|
||||
movzx eax,word [0xfb4a]
|
||||
movzx ebx,word [0xfb4c]
|
||||
movzx eax,word [X_UNDER]
|
||||
movzx ebx,word [Y_UNDER]
|
||||
stdcall [hw_restore], eax, ebx
|
||||
popad
|
||||
ret
|
||||
@ -54,8 +54,8 @@ draw_mouse_under:
|
||||
xor edx,edx
|
||||
align 4
|
||||
mres:
|
||||
movzx eax,word [0xfb4a]
|
||||
movzx ebx,word [0xfb4c]
|
||||
movzx eax,word [X_UNDER]
|
||||
movzx ebx,word [Y_UNDER]
|
||||
add eax,ecx
|
||||
add ebx,edx
|
||||
push ecx
|
||||
@ -90,14 +90,14 @@ save_draw_mouse:
|
||||
jz @F
|
||||
pushad
|
||||
|
||||
mov [0xfb4a],ax
|
||||
mov [0xfb4c],bx
|
||||
movzx eax,word [0xfb0c]
|
||||
movzx ebx,word [0xfb0a]
|
||||
mov [X_UNDER],ax
|
||||
mov [Y_UNDER],bx
|
||||
movzx eax,word [MOUSE_Y]
|
||||
movzx ebx,word [MOUSE_X]
|
||||
push eax
|
||||
push ebx
|
||||
|
||||
mov ecx, [0xfe00]
|
||||
mov ecx, [ScreenWidth]
|
||||
inc ecx
|
||||
mul ecx
|
||||
movzx edx, byte [display_data+ebx+eax]
|
||||
@ -123,8 +123,8 @@ save_draw_mouse:
|
||||
@@:
|
||||
pushad
|
||||
; save & draw
|
||||
mov [0xfb4a],ax
|
||||
mov [0xfb4c],bx
|
||||
mov [X_UNDER],ax
|
||||
mov [Y_UNDER],bx
|
||||
push eax
|
||||
push ebx
|
||||
mov ecx,0
|
||||
@ -141,14 +141,14 @@ drm:
|
||||
add ebx,edx
|
||||
push ecx
|
||||
call getpixel
|
||||
mov [0xfb30],ecx
|
||||
mov [COLOR_TEMP],ecx
|
||||
pop ecx
|
||||
mov eax,edx
|
||||
shl eax,6
|
||||
shl ecx,2
|
||||
add eax,ecx
|
||||
add eax,mouseunder
|
||||
mov ebx,[0xfb30]
|
||||
mov ebx,[COLOR_TEMP]
|
||||
mov [eax],ebx
|
||||
pop ecx
|
||||
mov edi,edx ; y cycle
|
||||
@ -157,13 +157,13 @@ drm:
|
||||
mov esi, edi
|
||||
add edi, esi
|
||||
add edi, esi ; *3
|
||||
add edi,[0xf200] ; we have our str address
|
||||
add edi,[MOUSE_PICTURE] ; we have our str address
|
||||
mov esi, edi
|
||||
add esi, 16*24*3
|
||||
push ecx
|
||||
mov ecx, [0xfb30]
|
||||
mov ecx, [COLOR_TEMP]
|
||||
call combine_colors
|
||||
mov [0xfb10], ecx
|
||||
mov [MOUSE_COLOR_MEM], ecx
|
||||
pop ecx
|
||||
pop edx
|
||||
pop ecx
|
||||
@ -172,7 +172,7 @@ drm:
|
||||
add eax,ecx ; we have x coord+cycle
|
||||
add ebx,edx ; and y coord+cycle
|
||||
push ecx
|
||||
mov ecx, [0xfb10]
|
||||
mov ecx, [MOUSE_COLOR_MEM]
|
||||
mov edi, 1
|
||||
call [putpixel]
|
||||
pop ecx
|
||||
@ -260,7 +260,7 @@ combine_colors:
|
||||
|
||||
|
||||
__sys_disable_mouse:
|
||||
cmp dword [0xf204],dword 0
|
||||
cmp dword [MOUSE_VISIBLE],dword 0
|
||||
je @f
|
||||
ret
|
||||
@@:
|
||||
@ -270,9 +270,9 @@ __sys_disable_mouse:
|
||||
mov edx,[CURRENT_TASK]
|
||||
shl edx,5
|
||||
add edx,window_data
|
||||
movzx eax, word [0xfb0a]
|
||||
movzx ebx, word [0xfb0c]
|
||||
mov ecx,[0xfe00]
|
||||
movzx eax, word [MOUSE_X]
|
||||
movzx ebx, word [MOUSE_Y]
|
||||
mov ecx,[ScreenWidth]
|
||||
inc ecx
|
||||
imul ecx,ebx
|
||||
add ecx,eax
|
||||
@ -284,7 +284,7 @@ __sys_disable_mouse:
|
||||
movzx ebx, byte [ecx+16]
|
||||
cmp eax,ebx
|
||||
je yes_mouse_disable
|
||||
mov ebx,[0xfe00]
|
||||
mov ebx,[ScreenWidth]
|
||||
inc ebx
|
||||
imul ebx,10
|
||||
add ecx,ebx
|
||||
@ -299,8 +299,8 @@ yes_mouse_disable:
|
||||
mov edx,[CURRENT_TASK]
|
||||
shl edx,5
|
||||
add edx,window_data
|
||||
movzx eax, word [0xfb0a]
|
||||
movzx ebx, word [0xfb0c]
|
||||
movzx eax, word [MOUSE_X]
|
||||
movzx ebx, word [MOUSE_Y]
|
||||
mov ecx,[edx+0] ; mouse inside the area ?
|
||||
add eax,14
|
||||
cmp eax,ecx
|
||||
@ -318,12 +318,12 @@ yes_mouse_disable:
|
||||
cmp ebx,ecx
|
||||
jg no_mouse_disable
|
||||
disable_m:
|
||||
cmp dword [0xf204],dword 0
|
||||
cmp dword [MOUSE_VISIBLE],dword 0
|
||||
jne no_mouse_disable
|
||||
cli
|
||||
call draw_mouse_under
|
||||
sti
|
||||
mov [0xf204],dword 1
|
||||
mov [MOUSE_VISIBLE],dword 1
|
||||
no_mouse_disable:
|
||||
popad
|
||||
ret
|
||||
@ -345,11 +345,11 @@ __sys_draw_pointer:
|
||||
mov [MouseTickCounter],eax
|
||||
pop eax
|
||||
pushad
|
||||
cmp dword [0xf204],dword 0 ; mouse visible ?
|
||||
cmp dword [MOUSE_VISIBLE],dword 0 ; mouse visible ?
|
||||
je chms00
|
||||
mov [0xf204], dword 0
|
||||
movzx ebx,word [0xfb0c]
|
||||
movzx eax,word [0xfb0a]
|
||||
mov [MOUSE_VISIBLE], dword 0
|
||||
movzx ebx,word [MOUSE_Y]
|
||||
movzx eax,word [MOUSE_X]
|
||||
cli
|
||||
call save_draw_mouse
|
||||
sti
|
||||
@ -357,10 +357,10 @@ nodmu2:
|
||||
popad
|
||||
ret
|
||||
chms00:
|
||||
movzx ecx,word [0xfb4a]
|
||||
movzx edx,word [0xfb4c]
|
||||
movzx ebx,word [0xfb0c]
|
||||
movzx eax,word [0xfb0a]
|
||||
movzx ecx,word [X_UNDER]
|
||||
movzx edx,word [Y_UNDER]
|
||||
movzx ebx,word [MOUSE_Y]
|
||||
movzx eax,word [MOUSE_X]
|
||||
cmp eax,ecx
|
||||
jne redrawmouse
|
||||
cmp ebx,edx
|
||||
|
@ -298,26 +298,26 @@ B32:
|
||||
mov al, [0x2F0000+0x901F] ; DMA writing
|
||||
mov [allow_dma_write], al
|
||||
mov al,[0x2f0000+0x9000] ; bpp
|
||||
mov [0xFBF1],al
|
||||
mov [ScreenBPP],al
|
||||
movzx eax,word [0x2f0000+0x900A] ; X max
|
||||
dec eax
|
||||
mov [0xfe00],eax
|
||||
mov [ScreenWidth],eax
|
||||
mov [screen_workarea.right],eax
|
||||
movzx eax,word [0x2f0000+0x900C] ; Y max
|
||||
dec eax
|
||||
mov [0xfe04],eax
|
||||
mov [ScreenHeight],eax
|
||||
mov [screen_workarea.bottom],eax
|
||||
movzx eax,word [0x2f0000+0x9008] ; screen mode
|
||||
mov [0xFE0C],eax
|
||||
mov [SCR_MODE],eax
|
||||
mov eax,[0x2f0000+0x9014] ; Vesa 1.2 bnk sw add
|
||||
mov [0xE030],eax
|
||||
mov [0xfe08],word 640*4 ; Bytes PerScanLine
|
||||
cmp [0xFE0C],word 0x13 ; 320x200
|
||||
mov [BANK_SWITCH],eax
|
||||
mov [BytesPerScanLine],word 640*4 ; Bytes PerScanLine
|
||||
cmp [SCR_MODE],word 0x13 ; 320x200
|
||||
je @f
|
||||
cmp [0xFE0C],word 0x12 ; VGA 640x480
|
||||
cmp [SCR_MODE],word 0x12 ; VGA 640x480
|
||||
je @f
|
||||
mov ax,[0x2f0000+0x9001] ; for other modes
|
||||
mov [0xfe08],ax
|
||||
mov [BytesPerScanLine],ax
|
||||
@@:
|
||||
|
||||
; GRAPHICS ADDRESSES
|
||||
@ -334,30 +334,30 @@ B32:
|
||||
;no_d_lfb:
|
||||
mov [LFBAddress],eax
|
||||
|
||||
cmp [0xfe0c],word 0100000000000000b
|
||||
cmp [SCR_MODE],word 0100000000000000b
|
||||
jge setvesa20
|
||||
cmp [0xfe0c],word 0x13
|
||||
cmp [SCR_MODE],word 0x13
|
||||
je v20ga32
|
||||
mov [0xe020],dword Vesa12_putpixel24 ; Vesa 1.2
|
||||
mov [PUTPIXEL],dword Vesa12_putpixel24 ; Vesa 1.2
|
||||
mov [0xe024],dword Vesa12_getpixel24
|
||||
cmp [0xfbf1],byte 24
|
||||
cmp [ScreenBPP],byte 24
|
||||
jz ga24
|
||||
mov [0xe020],dword Vesa12_putpixel32
|
||||
mov [PUTPIXEL],dword Vesa12_putpixel32
|
||||
mov [0xe024],dword Vesa12_getpixel32
|
||||
ga24:
|
||||
jmp v20ga24
|
||||
setvesa20:
|
||||
mov [0xe020],dword Vesa20_putpixel24 ; Vesa 2.0
|
||||
mov [PUTPIXEL],dword Vesa20_putpixel24 ; Vesa 2.0
|
||||
mov [0xe024],dword Vesa20_getpixel24
|
||||
cmp [0xfbf1],byte 24
|
||||
cmp [ScreenBPP],byte 24
|
||||
jz v20ga24
|
||||
v20ga32:
|
||||
mov [0xe020],dword Vesa20_putpixel32
|
||||
mov [PUTPIXEL],dword Vesa20_putpixel32
|
||||
mov [0xe024],dword Vesa20_getpixel32
|
||||
v20ga24:
|
||||
cmp [0xfe0c],word 0x12 ; 16 C VGA 640x480
|
||||
cmp [SCR_MODE],word 0x12 ; 16 C VGA 640x480
|
||||
jne no_mode_0x12
|
||||
mov [0xe020],dword VGA_putpixel
|
||||
mov [PUTPIXEL],dword VGA_putpixel
|
||||
mov [0xe024],dword Vesa20_getpixel32
|
||||
no_mode_0x12:
|
||||
|
||||
@ -512,13 +512,13 @@ include 'vmodeld.inc'
|
||||
mov esi,char
|
||||
xor ebx,ebx
|
||||
mov ecx,2560;26000
|
||||
mov edx,0x3F600;0x37000
|
||||
mov edx,FONT_I
|
||||
call fs_RamdiskRead
|
||||
|
||||
mov esi,char2
|
||||
xor ebx,ebx
|
||||
mov ecx,2560;26000
|
||||
mov edx,0x3EC00;0x30000
|
||||
mov edx,FONT_II
|
||||
call fs_RamdiskRead
|
||||
|
||||
mov esi,boot_fonts
|
||||
@ -680,7 +680,7 @@ include 'vmodeld.inc'
|
||||
call _rdtsc
|
||||
sub eax,ecx
|
||||
shl eax,2
|
||||
mov [0xf600],eax ; save tsc / sec
|
||||
mov [CPU_FREQ],eax ; save tsc / sec
|
||||
mov ebx, 1000000
|
||||
div ebx
|
||||
mov [stall_mcs], eax
|
||||
@ -696,14 +696,14 @@ include 'vmodeld.inc'
|
||||
|
||||
; PALETTE FOR 320x200 and 640x480 16 col
|
||||
|
||||
cmp [0xfe0c],word 0x12
|
||||
cmp [SCR_MODE],word 0x12
|
||||
jne no_pal_vga
|
||||
mov esi,boot_pal_vga
|
||||
call boot_log
|
||||
call paletteVGA
|
||||
no_pal_vga:
|
||||
|
||||
cmp [0xfe0c],word 0x13
|
||||
cmp [SCR_MODE],word 0x13
|
||||
jne no_pal_ega
|
||||
mov esi,boot_pal_ega
|
||||
call boot_log
|
||||
@ -782,7 +782,7 @@ first_app_found:
|
||||
mov esi,boot_tasking
|
||||
call boot_log
|
||||
|
||||
mov [0xe000],byte 1 ; multitasking enabled
|
||||
; mov [ENABLE_TASKSWITCH],byte 1 ; multitasking enabled
|
||||
|
||||
; UNMASK ALL IRQ'S
|
||||
|
||||
@ -935,32 +935,32 @@ reserve_irqs_ports:
|
||||
|
||||
; RESERVE PORTS
|
||||
mov edi,1 ; 0x00-0x2d
|
||||
mov [0x2d0000],edi
|
||||
mov [RESERVED_PORTS],edi
|
||||
shl edi,4
|
||||
mov [0x2d0000+edi+0],dword 1
|
||||
mov [0x2d0000+edi+4],dword 0x0
|
||||
mov [0x2d0000+edi+8],dword 0x2d
|
||||
mov [RESERVED_PORTS+edi+0],dword 1
|
||||
mov [RESERVED_PORTS+edi+4],dword 0x0
|
||||
mov [RESERVED_PORTS+edi+8],dword 0x2d
|
||||
|
||||
inc dword [0x2d0000] ; 0x30-0x4d
|
||||
mov edi,[0x2d0000]
|
||||
inc dword [RESERVED_PORTS] ; 0x30-0x4d
|
||||
mov edi,[RESERVED_PORTS]
|
||||
shl edi,4
|
||||
mov [0x2d0000+edi+0],dword 1
|
||||
mov [0x2d0000+edi+4],dword 0x30
|
||||
mov [0x2d0000+edi+8],dword 0x4d
|
||||
mov [RESERVED_PORTS+edi+0],dword 1
|
||||
mov [RESERVED_PORTS+edi+4],dword 0x30
|
||||
mov [RESERVED_PORTS+edi+8],dword 0x4d
|
||||
|
||||
inc dword [0x2d0000] ; 0x50-0xdf
|
||||
mov edi,[0x2d0000]
|
||||
inc dword [RESERVED_PORTS] ; 0x50-0xdf
|
||||
mov edi,[RESERVED_PORTS]
|
||||
shl edi,4
|
||||
mov [0x2d0000+edi+0],dword 1
|
||||
mov [0x2d0000+edi+4],dword 0x50
|
||||
mov [0x2d0000+edi+8],dword 0xdf
|
||||
mov [RESERVED_PORTS+edi+0],dword 1
|
||||
mov [RESERVED_PORTS+edi+4],dword 0x50
|
||||
mov [RESERVED_PORTS+edi+8],dword 0xdf
|
||||
|
||||
inc dword [0x2d0000] ; 0xe5-0xff
|
||||
mov edi,[0x2d0000]
|
||||
inc dword [RESERVED_PORTS] ; 0xe5-0xff
|
||||
mov edi,[RESERVED_PORTS]
|
||||
shl edi,4
|
||||
mov [0x2d0000+edi+0],dword 1
|
||||
mov [0x2d0000+edi+4],dword 0xe5
|
||||
mov [0x2d0000+edi+8],dword 0xff
|
||||
mov [RESERVED_PORTS+edi+0],dword 1
|
||||
mov [RESERVED_PORTS+edi+4],dword 0xe5
|
||||
mov [RESERVED_PORTS+edi+8],dword 0xff
|
||||
|
||||
|
||||
; cmp [0xf604],byte 2 ; com1 mouse -> 0x3f0-0x3ff
|
||||
@ -1011,10 +1011,10 @@ set_variables:
|
||||
mov ecx,0x100 ; flush port 0x60
|
||||
.fl60: in al,0x60
|
||||
loop .fl60
|
||||
mov [0xfcff],byte 0 ; mouse buffer
|
||||
mov [0xf400],byte 0 ; keyboard buffer
|
||||
mov [0xf500],byte 0 ; button buffer
|
||||
; mov [0xfb0a],dword 100*65536+100 ; mouse x/y
|
||||
mov [MOUSE_BUFF_COUNT],byte 0 ; mouse buffer
|
||||
mov [KEY_COUNT],byte 0 ; keyboard buffer
|
||||
mov [BTN_COUNT],byte 0 ; button buffer
|
||||
; mov [MOUSE_X],dword 100*65536+100 ; mouse x/y
|
||||
|
||||
push eax
|
||||
mov ax,[0x2f0000+0x900c]
|
||||
@ -1022,12 +1022,12 @@ set_variables:
|
||||
shl eax,16
|
||||
mov ax,[0x2f0000+0x900A]
|
||||
shr ax,1
|
||||
mov [0xfb0a],eax
|
||||
mov [MOUSE_X],eax
|
||||
pop eax
|
||||
|
||||
mov byte [SB16_Status],0 ; Minazzi Paolo
|
||||
mov [display_data-12],dword 1 ; tiled background
|
||||
mov [0xfe88],dword 0x2C0000 ; address of button list
|
||||
mov [BTN_ADDR],dword BUTTON_INFO ; address of button list
|
||||
|
||||
;!! IP 04.02.2005:
|
||||
mov [next_usage_update], 100
|
||||
@ -1038,12 +1038,12 @@ set_variables:
|
||||
;* mouse centered - start code- Mario79
|
||||
mouse_centered:
|
||||
push eax
|
||||
mov eax,[0xFE00]
|
||||
mov eax,[ScreenWidth]
|
||||
shr eax,1
|
||||
mov [0xFB0A],ax
|
||||
mov eax,[0xFE04]
|
||||
mov [MOUSE_X],ax
|
||||
mov eax,[ScreenHeight]
|
||||
shr eax,1
|
||||
mov [0xFB0C],ax
|
||||
mov [MOUSE_Y],ax
|
||||
pop eax
|
||||
ret
|
||||
;* mouse centered - end code- Mario79
|
||||
@ -1055,7 +1055,7 @@ sys_outport:
|
||||
mov edi,ebx ; separate flag for read / write
|
||||
and ebx,65535
|
||||
|
||||
mov ecx,[0x2d0000]
|
||||
mov ecx,[RESERVED_PORTS]
|
||||
test ecx,ecx
|
||||
jne sopl8
|
||||
mov [esp+36],dword 1
|
||||
@ -1070,7 +1070,7 @@ sys_outport:
|
||||
|
||||
mov esi,ecx
|
||||
shl esi,4
|
||||
add esi,0x2d0000
|
||||
add esi,RESERVED_PORTS
|
||||
cmp edx,[esi+0]
|
||||
jne sopl2
|
||||
cmp ebx,[esi+4]
|
||||
@ -1725,15 +1725,15 @@ readmousepos:
|
||||
ja msset
|
||||
jmp [mousefn+eax*4]
|
||||
msscreen:
|
||||
mov eax,[0xfb0a]
|
||||
mov eax,[MOUSE_X]
|
||||
shl eax,16
|
||||
mov ax,[0xfb0c]
|
||||
mov ax,[MOUSE_Y]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
mswin:
|
||||
mov eax,[0xfb0a]
|
||||
mov eax,[MOUSE_X]
|
||||
shl eax,16
|
||||
mov ax,[0xfb0c]
|
||||
mov ax,[MOUSE_Y]
|
||||
mov esi,[TASK_BASE]
|
||||
mov bx, word [esi-twdw+WDATA.box.left]
|
||||
shl ebx,16
|
||||
@ -1749,7 +1749,7 @@ mswin:
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
msbutton:
|
||||
movzx eax,byte [0xfb40]
|
||||
movzx eax,byte [BTN_DOWN]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
msset:
|
||||
@ -1935,7 +1935,7 @@ sysfn_shutdown: ; 18.1 = BOOT
|
||||
mov eax,[TASK_COUNT]
|
||||
add eax,2
|
||||
mov [shutdown_processes],eax
|
||||
mov [0xFF00],al
|
||||
mov [SYS_SHUTDOWN],al
|
||||
and dword [esp+36], 0
|
||||
ret
|
||||
uglobal
|
||||
@ -2020,7 +2020,7 @@ sysfn_getidletime: ; 18.4 = GET IDLETIME
|
||||
ret
|
||||
|
||||
sysfn_getcpuclock: ; 18.5 = GET TSC/SEC
|
||||
mov eax,[0xf600]
|
||||
mov eax,[CPU_FREQ]
|
||||
mov [esp+36], eax
|
||||
ret
|
||||
|
||||
@ -2074,7 +2074,7 @@ sysfn_getdiskinfo: ; 18.11 = get disk info table
|
||||
mov edi,[TASK_BASE]
|
||||
mov edi,[edi+TASKDATA.mem_start]
|
||||
add edi,ecx
|
||||
mov esi,0x40000
|
||||
mov esi,DRIVE_DATA
|
||||
ret
|
||||
full_table:
|
||||
cmp ebx,2
|
||||
@ -2141,9 +2141,9 @@ sysfn_mouse_acceleration: ; 18.19 = set/get mouse features
|
||||
.set_pointer_position:
|
||||
cmp ebx,4 ; set mouse pointer position
|
||||
jnz .end
|
||||
mov [0xFB0C],cx ;y
|
||||
mov [MOUSE_Y],cx ;y
|
||||
ror ecx,16
|
||||
mov [0xFB0A],cx ;x
|
||||
mov [MOUSE_X],cx ;x
|
||||
rol ecx,16
|
||||
.end:
|
||||
ret
|
||||
@ -2255,7 +2255,7 @@ sys_background:
|
||||
and edx,0xFF000000 ;255*256*256*256
|
||||
and ecx,0x00FFFFFF ;255*256*256+255*256+255
|
||||
add edx,ecx
|
||||
mov [ebx+0x300000],edx
|
||||
mov [ebx+IMG_BACKGROUND],edx
|
||||
; mov [bgrchanged],1
|
||||
ret
|
||||
nosb2:
|
||||
@ -2267,7 +2267,7 @@ draw_background_temp:
|
||||
; je nosb31
|
||||
;draw_background_temp:
|
||||
; mov [bgrchanged],1 ;0
|
||||
mov [0xfff0],byte 1
|
||||
mov [REDRAW_BACKGROUND],byte 1
|
||||
mov [background_defined], 1
|
||||
nosb31:
|
||||
ret
|
||||
@ -2296,7 +2296,7 @@ draw_background_temp:
|
||||
cmp ecx, 0x160000-16
|
||||
ja .fin
|
||||
; add edi, 0x300000
|
||||
add ebx, 0x300000
|
||||
add ebx, IMG_BACKGROUND
|
||||
mov ecx, edx
|
||||
cmp ecx, 0x160000-16
|
||||
ja .fin
|
||||
@ -2329,7 +2329,7 @@ sys_getbackground:
|
||||
mov edx,0x160000-16
|
||||
cmp edx,ebx
|
||||
jbe nogb2
|
||||
mov eax, [ebx+0x300000]
|
||||
mov eax, [ebx+IMG_BACKGROUND]
|
||||
and eax, 0xFFFFFF
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
@ -2353,21 +2353,21 @@ sys_getkey:
|
||||
mov edx,[TASK_COUNT]
|
||||
cmp ecx,edx
|
||||
jne .finish
|
||||
cmp [0xf400],byte 0
|
||||
cmp [KEY_COUNT],byte 0
|
||||
je .finish
|
||||
movzx eax,byte [0xf401]
|
||||
movzx eax,byte [KEY_BUFF]
|
||||
shl eax,8
|
||||
push eax
|
||||
dec byte [0xf400]
|
||||
and byte [0xf400],127
|
||||
movzx ecx,byte [0xf400]
|
||||
dec byte [KEY_COUNT]
|
||||
and byte [KEY_COUNT],127
|
||||
movzx ecx,byte [KEY_COUNT]
|
||||
add ecx,2
|
||||
; mov esi,0xf402
|
||||
; mov edi,0xf401
|
||||
; cld
|
||||
; rep movsb
|
||||
mov eax, 0xF402
|
||||
mov ebx, 0xF401
|
||||
mov eax, KEY_BUFF+1
|
||||
mov ebx, KEY_BUFF
|
||||
call memmove
|
||||
pop eax
|
||||
.ret_eax:
|
||||
@ -2402,12 +2402,12 @@ sys_getbutton:
|
||||
mov edx, [TASK_COUNT] ; less than 256 processes
|
||||
cmp ecx,edx
|
||||
jne .exit
|
||||
movzx eax,byte [0xf500]
|
||||
movzx eax,byte [BTN_COUNT]
|
||||
test eax,eax
|
||||
jz .exit
|
||||
mov eax,[0xf501]
|
||||
mov eax,[BTN_BUFF]
|
||||
shl eax,8
|
||||
mov [0xf500],byte 0
|
||||
mov [BTN_COUNT],byte 0
|
||||
mov [esp+36],eax
|
||||
.exit:
|
||||
ret
|
||||
@ -2623,7 +2623,7 @@ sys_redrawstat:
|
||||
|
||||
sys_newba2:
|
||||
|
||||
mov edi,[0xfe88]
|
||||
mov edi,[BTN_ADDR]
|
||||
cmp [edi],dword 0 ; empty button list ?
|
||||
je end_of_buttons_away
|
||||
|
||||
@ -2666,9 +2666,9 @@ sys_redrawstat:
|
||||
add edx,draw_data-CURRENT_TASK
|
||||
mov [edx+RECT.left], 0
|
||||
mov [edx+RECT.top], 0
|
||||
mov eax,[0xfe00]
|
||||
mov eax,[ScreenWidth]
|
||||
mov [edx+RECT.right],eax
|
||||
mov eax,[0xfe04]
|
||||
mov eax,[ScreenHeight]
|
||||
mov [edx+RECT.bottom],eax
|
||||
|
||||
mov edi,[TASK_BASE]
|
||||
@ -2979,8 +2979,8 @@ sys_set_window:
|
||||
call calculatescreen
|
||||
pop edx ecx ebx eax
|
||||
|
||||
mov [0xf400],byte 0 ; empty keyboard buffer
|
||||
mov [0xf500],byte 0 ; empty button buffer
|
||||
mov [KEY_COUNT],byte 0 ; empty keyboard buffer
|
||||
mov [BTN_COUNT],byte 0 ; empty button buffer
|
||||
|
||||
newd:
|
||||
mov [edi+WDATA.fl_redraw],byte 0 ; no redraw
|
||||
@ -3108,9 +3108,9 @@ sys_window_move:
|
||||
xor esi,esi
|
||||
call redrawscreen
|
||||
|
||||
mov [0xfff5],byte 0 ; mouse pointer
|
||||
mov [0xfff4],byte 0 ; no mouse under
|
||||
mov [0xfb44],byte 0 ; react to mouse up/down
|
||||
mov [DONT_DRAW_MOUSE],byte 0 ; mouse pointer
|
||||
mov [MOUSE_BACKGROUND],byte 0 ; no mouse under
|
||||
mov [MOUSE_DOWN],byte 0 ; react to mouse up/down
|
||||
|
||||
mov ecx,10 ; wait 1/10 second
|
||||
.wmrl3:
|
||||
@ -3132,13 +3132,13 @@ sys_window_move:
|
||||
; call change_task
|
||||
; mov [draw_data+32+0],dword 0
|
||||
; mov [draw_data+32+4],dword 0
|
||||
; mov eax,[0xfe00]
|
||||
; mov eax,[ScreenWidth
|
||||
; mov ebx,[0xfe04]
|
||||
; mov [draw_data+32+8],eax
|
||||
; mov [draw_data+32+12],ebx
|
||||
; call drawbackground
|
||||
; mov [0xfff0],byte 0
|
||||
; mov [0xfff4],byte 0
|
||||
; mov [MOUSE_BACKGROUND],byte 0
|
||||
;temp_nobackgr:
|
||||
; ret
|
||||
|
||||
@ -3258,7 +3258,7 @@ ret
|
||||
checkpixel:
|
||||
push eax edx
|
||||
|
||||
mov edx,[0xfe00] ; screen x size
|
||||
mov edx,[ScreenWidth] ; screen x size
|
||||
inc edx
|
||||
imul edx, ebx
|
||||
mov dl, [eax+edx+display_data] ; lea eax, [...]
|
||||
@ -3308,38 +3308,38 @@ checkmisc:
|
||||
mouse_not_active:
|
||||
|
||||
|
||||
cmp [0xfff0],byte 0 ; background update ?
|
||||
cmp [REDRAW_BACKGROUND],byte 0 ; background update ?
|
||||
jz nobackgr
|
||||
cmp [background_defined], 0
|
||||
jz nobackgr
|
||||
mov [0xfff0],byte 2
|
||||
mov [REDRAW_BACKGROUND],byte 2
|
||||
call change_task
|
||||
mov [draw_data+32 + RECT.left],dword 0
|
||||
mov [draw_data+32 + RECT.top],dword 0
|
||||
mov eax,[0xfe00]
|
||||
mov ebx,[0xfe04]
|
||||
mov eax,[ScreenWidth]
|
||||
mov ebx,[ScreenHeight]
|
||||
mov [draw_data+32 + RECT.right],eax
|
||||
mov [draw_data+32 + RECT.bottom],ebx
|
||||
call drawbackground
|
||||
mov [0xfff0],byte 0
|
||||
mov [0xfff4],byte 0
|
||||
mov [REDRAW_BACKGROUND],byte 0
|
||||
mov [MOUSE_BACKGROUND],byte 0
|
||||
|
||||
nobackgr:
|
||||
|
||||
|
||||
; system shutdown request
|
||||
|
||||
cmp [0xFF00],byte 0
|
||||
cmp [SYS_SHUTDOWN],byte 0
|
||||
je noshutdown
|
||||
|
||||
mov edx,[shutdown_processes]
|
||||
sub dl,2
|
||||
|
||||
cmp [0xff00],dl
|
||||
cmp [SYS_SHUTDOWN],dl
|
||||
jne no_mark_system_shutdown
|
||||
|
||||
mov edx,0x3040
|
||||
movzx ecx,byte [0xff00]
|
||||
movzx ecx,byte [SYS_SHUTDOWN]
|
||||
add ecx,5
|
||||
markz:
|
||||
mov [edx+TASKDATA.state],byte 3
|
||||
@ -3350,9 +3350,9 @@ checkmisc:
|
||||
|
||||
call [disable_mouse]
|
||||
|
||||
dec byte [0xff00]
|
||||
dec byte [SYS_SHUTDOWN]
|
||||
|
||||
cmp [0xff00],byte 0
|
||||
cmp [SYS_SHUTDOWN],byte 0
|
||||
je system_shutdown
|
||||
|
||||
noshutdown:
|
||||
@ -3491,7 +3491,7 @@ calculatebackground: ; background
|
||||
mov [display_data-8],dword 4 ; size x
|
||||
mov [display_data-4],dword 2 ; size y
|
||||
|
||||
mov edi, 0x300000 ; set background to black
|
||||
mov edi, IMG_BACKGROUND ; set background to black
|
||||
xor eax, eax
|
||||
mov ecx, 0x0fff00 / 4
|
||||
cld
|
||||
@ -3502,7 +3502,7 @@ calculatebackground: ; background
|
||||
mov ecx,0x15ff00 / 4
|
||||
rep stosd
|
||||
|
||||
mov byte [0xFFF0], 0 ; do not draw background!
|
||||
mov byte [REDRAW_BACKGROUND], 0 ; do not draw background!
|
||||
|
||||
ret
|
||||
|
||||
@ -3709,7 +3709,7 @@ get_irq_data:
|
||||
|
||||
mov ebx,eax
|
||||
shl ebx,12
|
||||
add ebx,0x2e0000
|
||||
add ebx,IRQ_SAVE
|
||||
mov eax,[ebx]
|
||||
mov ecx,1
|
||||
test eax,eax
|
||||
@ -3784,7 +3784,7 @@ r_f_port_area:
|
||||
ja rpal1
|
||||
cmp ecx,65536
|
||||
jae rpal1
|
||||
mov esi,[0x2d0000]
|
||||
mov esi,[RESERVED_PORTS]
|
||||
test esi,esi ; no reserved areas ?
|
||||
je rpal2
|
||||
cmp esi,255 ; max reserved
|
||||
@ -3792,7 +3792,7 @@ r_f_port_area:
|
||||
rpal3:
|
||||
mov edi,esi
|
||||
shl edi,4
|
||||
add edi,0x2d0000
|
||||
add edi,RESERVED_PORTS
|
||||
cmp ebx,[edi+8]
|
||||
ja rpal4
|
||||
cmp ecx,[edi+4]
|
||||
@ -3840,11 +3840,11 @@ r_f_port_area:
|
||||
popad ; end enable io map
|
||||
sti
|
||||
|
||||
mov edi,[0x2d0000]
|
||||
mov edi,[RESERVED_PORTS]
|
||||
add edi,1
|
||||
mov [0x2d0000],edi
|
||||
mov [RESERVED_PORTS],edi
|
||||
shl edi,4
|
||||
add edi,0x2d0000
|
||||
add edi,RESERVED_PORTS
|
||||
mov esi,[TASK_BASE]
|
||||
mov esi,[esi+TASKDATA.pid]
|
||||
mov [edi],esi
|
||||
@ -3858,7 +3858,7 @@ free_port_area:
|
||||
|
||||
pushad
|
||||
|
||||
mov esi,[0x2d0000] ; no reserved areas ?
|
||||
mov esi,[RESERVED_PORTS] ; no reserved areas ?
|
||||
test esi,esi
|
||||
je frpal2
|
||||
mov edx,[TASK_BASE]
|
||||
@ -3866,7 +3866,7 @@ free_port_area:
|
||||
frpal3:
|
||||
mov edi,esi
|
||||
shl edi,4
|
||||
add edi,0x2d0000
|
||||
add edi,RESERVED_PORTS
|
||||
cmp edx,[edi]
|
||||
jne frpal4
|
||||
cmp ebx,[edi+4]
|
||||
@ -3890,7 +3890,7 @@ free_port_area:
|
||||
cld
|
||||
rep movsb
|
||||
|
||||
dec dword [0x2d0000]
|
||||
dec dword [RESERVED_PORTS]
|
||||
|
||||
popad
|
||||
|
||||
@ -3960,12 +3960,12 @@ reserve_free_irq:
|
||||
|
||||
drawbackground:
|
||||
inc [mouse_pause]
|
||||
cmp [0xfe0c],word 0x12
|
||||
cmp [SCR_MODE],word 0x12
|
||||
je dbrv20
|
||||
dbrv12:
|
||||
cmp [0xfe0c],word 0100000000000000b
|
||||
cmp [SCR_MODE],word 0100000000000000b
|
||||
jge dbrv20
|
||||
cmp [0xfe0c],word 0x13
|
||||
cmp [SCR_MODE],word 0x13
|
||||
je dbrv20
|
||||
call vesa12_drawbackground
|
||||
dec [mouse_pause]
|
||||
@ -4015,12 +4015,12 @@ sys_putimage:
|
||||
sys_putimage_bpp:
|
||||
; call [disable_mouse] ; this will be done in xxx_putimage
|
||||
; mov eax, vga_putimage
|
||||
cmp [0xfe0c], word 0x12
|
||||
cmp [SCR_MODE], word 0x12
|
||||
jz @f ;.doit
|
||||
mov eax, vesa12_putimage
|
||||
cmp [0xfe0c], word 0100000000000000b
|
||||
cmp [SCR_MODE], word 0100000000000000b
|
||||
jae @f
|
||||
cmp [0xfe0c], word 0x13
|
||||
cmp [SCR_MODE], word 0x13
|
||||
jnz .doit
|
||||
@@:
|
||||
mov eax, vesa20_putimage
|
||||
@ -4114,12 +4114,12 @@ __sys_drawbar:
|
||||
.forced:
|
||||
inc [mouse_pause]
|
||||
; call [disable_mouse]
|
||||
cmp [0xfe0c],word 0x12
|
||||
cmp [SCR_MODE],word 0x12
|
||||
je dbv20
|
||||
sdbv20:
|
||||
cmp [0xfe0c],word 0100000000000000b
|
||||
cmp [SCR_MODE],word 0100000000000000b
|
||||
jge dbv20
|
||||
cmp [0xfe0c],word 0x13
|
||||
cmp [SCR_MODE],word 0x13
|
||||
je dbv20
|
||||
call vesa12_drawbar
|
||||
dec [mouse_pause]
|
||||
@ -4244,7 +4244,7 @@ kb_cmd:
|
||||
setmouse: ; set mousepicture -pointer
|
||||
; ps2 mouse enable
|
||||
|
||||
mov [0xf200],dword mousepointer
|
||||
mov [MOUSE_PICTURE],dword mousepointer
|
||||
|
||||
cli
|
||||
; mov bl,0xa8 ; enable mouse cmd
|
||||
@ -4596,9 +4596,9 @@ sys_gs: ; direct screen access
|
||||
|
||||
cmp eax,1 ; resolution
|
||||
jne no_gs1
|
||||
mov eax,[0xfe00]
|
||||
mov eax,[ScreenWidth]
|
||||
shl eax,16
|
||||
mov ax,[0xfe04]
|
||||
mov ax,[ScreenHeight]
|
||||
add eax,0x00010001
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
@ -4606,14 +4606,14 @@ sys_gs: ; direct screen access
|
||||
|
||||
cmp eax,2 ; bits per pixel
|
||||
jne no_gs2
|
||||
movzx eax,byte [0xfbf1]
|
||||
movzx eax,byte [ScreenBPP]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
no_gs2:
|
||||
|
||||
cmp eax,3 ; bytes per scanline
|
||||
jne no_gs3
|
||||
mov eax,[0xfe08]
|
||||
mov eax,[BytesPerScanLine]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
no_gs3:
|
||||
@ -4709,9 +4709,9 @@ align 4
|
||||
|
||||
syscall_getscreensize: ; GetScreenSize
|
||||
|
||||
movzx eax,word[0xfe00]
|
||||
movzx eax,word[ScreenWidth]
|
||||
shl eax,16
|
||||
mov ax,[0xfe04]
|
||||
mov ax,[ScreenHeight]
|
||||
mov [esp+36],eax
|
||||
ret
|
||||
|
||||
@ -4749,7 +4749,7 @@ syscall_writeramdiskfile: ; WriteRamdiskFile
|
||||
align 4
|
||||
|
||||
syscall_getpixel: ; GetPixel
|
||||
mov ecx,[0xfe00]
|
||||
mov ecx,[ScreenWidth]
|
||||
inc ecx
|
||||
xor edx,edx
|
||||
div ecx
|
||||
|
@ -426,11 +426,11 @@ destroy_cursor:
|
||||
|
||||
align 4
|
||||
proc init_cursors
|
||||
cmp [0xfe0c],word 0x13
|
||||
cmp [SCR_MODE],word 0x13
|
||||
jbe .fail
|
||||
|
||||
movzx eax, byte [ScreenBPP]
|
||||
mov ebx, [SCR_BYTES_PER_LINE]
|
||||
mov ebx, [BytesPerScanLine]
|
||||
cmp eax, 32
|
||||
jne @F
|
||||
sub ebx, 128
|
||||
@ -456,8 +456,8 @@ proc init_cursors
|
||||
stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
|
||||
mov [def_cursor], eax
|
||||
|
||||
mov ecx, [SCR_X_SIZE]
|
||||
mov edx, [SCR_Y_SIZE]
|
||||
mov ecx, [ScreenWidth]
|
||||
mov edx, [ScreenHeight]
|
||||
inc ecx
|
||||
inc edx
|
||||
mov [scr_width], ecx
|
||||
|
@ -32,9 +32,9 @@
|
||||
; modified by Mario79
|
||||
;set_bank:
|
||||
;cli
|
||||
;cmp al,[0xfff2]
|
||||
;cmp al,[BANK_RW]
|
||||
;je retsb
|
||||
;mov [0xfff2],al
|
||||
;mov [BANK_RW],al
|
||||
;push dx
|
||||
;mov dx,3D8h
|
||||
;out dx,al
|
||||
@ -50,9 +50,9 @@
|
||||
set_bank:
|
||||
pushfd
|
||||
cli
|
||||
cmp al,[0xfff2]
|
||||
cmp al,[BANK_RW]
|
||||
je retsb
|
||||
mov [0xfff2],al
|
||||
mov [BANK_RW],al
|
||||
push ax
|
||||
push dx
|
||||
push cx
|
||||
@ -132,9 +132,9 @@ ret
|
||||
;
|
||||
;set_bank:
|
||||
;cli
|
||||
;cmp al,[0xfff2]
|
||||
;cmp al,[BANK_RW]
|
||||
;je retsb
|
||||
;mov [0xfff2],al
|
||||
;mov [BANK_RW],al
|
||||
;push ax
|
||||
;push dx
|
||||
;mov dx,3CEh
|
||||
@ -160,9 +160,9 @@ ret
|
||||
|
||||
;set_bank:
|
||||
; cli
|
||||
; cmp al,[0xfff2]
|
||||
; cmp al,[BANK_RW]
|
||||
; je retsb
|
||||
; mov [0xfff2],al
|
||||
; mov [BANK_RW],al
|
||||
; push ax
|
||||
; push dx
|
||||
; mov ah,al
|
||||
@ -216,7 +216,7 @@ vesa12_drawbackground:
|
||||
|
||||
push eax
|
||||
push ebx
|
||||
mov esi,0x300000
|
||||
mov esi,IMG_BACKGROUND
|
||||
|
||||
cmp [WinMapAddress-12],dword 1 ; tiled background
|
||||
jne no_vesa12_tiled_bgr
|
||||
@ -247,7 +247,7 @@ vesa12_drawbackground:
|
||||
|
||||
imul eax,dword [WinMapAddress-8]
|
||||
xor edx,edx
|
||||
mov ecx,[0xfe00]
|
||||
mov ecx,[ScreenWidth]
|
||||
inc ecx
|
||||
div ecx
|
||||
|
||||
@ -255,7 +255,7 @@ vesa12_drawbackground:
|
||||
mov eax,ebx
|
||||
imul eax,dword [WinMapAddress-4]
|
||||
xor edx,edx
|
||||
mov ecx,[0xfe04]
|
||||
mov ecx,[ScreenHeight]
|
||||
inc ecx
|
||||
div ecx
|
||||
mov ebx,eax
|
||||
@ -278,7 +278,7 @@ vesa12_drawbackground:
|
||||
add esi,eax
|
||||
add esi,eax
|
||||
add esi,eax
|
||||
add esi,0x300000
|
||||
add esi,IMG_BACKGROUND
|
||||
pop ebx
|
||||
pop eax
|
||||
|
||||
@ -288,20 +288,20 @@ vesa12_drawbackground:
|
||||
pusha
|
||||
mov esi,eax
|
||||
mov edi,ebx
|
||||
mov eax,[0xfe00]
|
||||
mov eax,[ScreenWidth]
|
||||
add eax,1
|
||||
mul ebx
|
||||
add eax,esi
|
||||
add eax,WinMapAddress
|
||||
cmp [eax],byte 1
|
||||
jnz v12nbgp
|
||||
mov eax,[0xfe08]
|
||||
mov eax,[BytesPerScanLine]
|
||||
mov ebx,edi
|
||||
mul ebx
|
||||
add eax,esi
|
||||
add eax,esi
|
||||
add eax,esi
|
||||
cmp [0xFBF1],byte 24
|
||||
cmp [ScreenBPP],byte 24
|
||||
jz v12bgl3
|
||||
add eax,esi
|
||||
|
||||
@ -310,13 +310,13 @@ vesa12_drawbackground:
|
||||
push ebx
|
||||
push eax
|
||||
|
||||
sub eax,[0xfe80]
|
||||
sub eax,[LFBAddress]
|
||||
|
||||
shr eax,16
|
||||
call set_bank
|
||||
pop eax
|
||||
and eax,65535
|
||||
add eax,0xa0000
|
||||
add eax,VGABasePtr
|
||||
pop ebx
|
||||
|
||||
mov [eax],cx
|
||||
@ -369,19 +369,19 @@ vesa12_drawbar:
|
||||
add ebx,[ecx-twdw+WDATA.box.top]
|
||||
push eax
|
||||
mov eax,ebx ; y
|
||||
mov ebx,[0xfe08]
|
||||
mov ebx,[BytesPerScanLine]
|
||||
mul ebx
|
||||
pop ecx
|
||||
add eax,ecx ; x
|
||||
add eax,ecx
|
||||
add eax,ecx
|
||||
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ? - x start
|
||||
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x start
|
||||
jz dbpi2412
|
||||
add eax,ecx
|
||||
|
||||
dbpi2412:
|
||||
|
||||
add eax,[0xfe80]
|
||||
add eax,[LFBAddress]
|
||||
mov edi,eax
|
||||
|
||||
; x size
|
||||
@ -390,7 +390,7 @@ vesa12_drawbar:
|
||||
mov ecx,eax
|
||||
add ecx,eax
|
||||
add ecx,eax
|
||||
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ? - x size
|
||||
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x size
|
||||
jz dbpi24312
|
||||
add ecx,eax
|
||||
|
||||
@ -410,10 +410,10 @@ vesa12_drawbar:
|
||||
cmp ecx,0
|
||||
jnz dbcblimitlset12
|
||||
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right]
|
||||
cmp ecx,[0xfe00]
|
||||
cmp ecx,[ScreenWidth]
|
||||
jnz dbcblimitlset12
|
||||
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom]
|
||||
cmp ecx,[0xfe04]
|
||||
cmp ecx,[ScreenHeight]
|
||||
jnz dbcblimitlset12
|
||||
pop ecx
|
||||
pop eax
|
||||
@ -428,7 +428,7 @@ vesa12_drawbar:
|
||||
|
||||
dbcblimitlno12:
|
||||
|
||||
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ?
|
||||
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ?
|
||||
jz dbpi24bit12
|
||||
jmp dbpi32bit12
|
||||
|
||||
@ -458,7 +458,7 @@ dbpi24bit12:
|
||||
|
||||
xor edx,edx
|
||||
mov eax,edi
|
||||
sub eax,[0xfe80]
|
||||
sub eax,[LFBAddress]
|
||||
mov ebx,3
|
||||
div ebx
|
||||
add eax,WinMapAddress
|
||||
@ -481,11 +481,11 @@ dbpi24bit12:
|
||||
|
||||
push edi
|
||||
mov eax,edi
|
||||
sub eax,[0xfe80]
|
||||
sub eax,[LFBAddress]
|
||||
shr eax,16
|
||||
call set_bank
|
||||
and edi,0xffff
|
||||
add edi,0xa0000
|
||||
add edi,VGABasePtr
|
||||
mov eax,[esp+8+3*4+16+4+4]
|
||||
stosw
|
||||
shr eax,16
|
||||
@ -523,7 +523,7 @@ dbpi24bit12:
|
||||
pop ecx
|
||||
pop edi
|
||||
pop ebx
|
||||
add edi,[0xfe08]
|
||||
add edi,[BytesPerScanLine]
|
||||
dec ebx
|
||||
jz dbnonewpi12
|
||||
jmp dbnewpi12
|
||||
@ -550,7 +550,7 @@ dbpi24bit12:
|
||||
push ecx
|
||||
|
||||
mov eax,edi
|
||||
sub eax,[0xfe80]
|
||||
sub eax,[LFBAddress]
|
||||
shr eax,2
|
||||
add eax,WinMapAddress
|
||||
mov ebx,[CURRENT_TASK]
|
||||
@ -572,11 +572,11 @@ dbpi24bit12:
|
||||
|
||||
push edi
|
||||
mov eax,edi
|
||||
sub eax,[0xfe80]
|
||||
sub eax,[LFBAddress]
|
||||
shr eax,16
|
||||
call set_bank
|
||||
and edi,0xffff
|
||||
add edi,0xa0000
|
||||
add edi,VGABasePtr
|
||||
mov eax,[esp+8+3*4+16+4+4]
|
||||
stosw
|
||||
shr eax,16
|
||||
@ -615,7 +615,7 @@ dbpi24bit12:
|
||||
pop ecx
|
||||
pop edi
|
||||
pop ebx
|
||||
add edi,[0xfe08]
|
||||
add edi,[BytesPerScanLine]
|
||||
dec ebx
|
||||
jz nodbnewpi3212
|
||||
jmp dbnewpi3212
|
||||
@ -631,14 +631,14 @@ Vesa12_putpixel24:
|
||||
mov edi,eax ; x
|
||||
mov eax,ebx ; y
|
||||
lea edi,[edi+edi*2]
|
||||
mov ebx,[0xfe08]
|
||||
mov ebx,[BytesPerScanLine]
|
||||
mul ebx
|
||||
add edi,eax
|
||||
mov eax,edi
|
||||
shr eax,16
|
||||
call set_bank
|
||||
and edi,65535
|
||||
add edi,0xa0000
|
||||
add edi,VGABasePtr
|
||||
mov eax,[esp+28]
|
||||
stosw
|
||||
shr eax,16
|
||||
@ -653,14 +653,14 @@ Vesa12_putpixel32:
|
||||
mov edi,eax ; x
|
||||
mov eax,ebx ; y
|
||||
shl edi,2
|
||||
mov ebx,[0xfe08]
|
||||
mov ebx,[BytesPerScanLine]
|
||||
mul ebx
|
||||
add edi,eax
|
||||
mov eax,edi
|
||||
shr eax,16
|
||||
call set_bank
|
||||
and edi,65535
|
||||
add edi,0xa0000
|
||||
add edi,VGABasePtr
|
||||
mov ecx,[esp+28]
|
||||
mov [edi],ecx
|
||||
sti
|
||||
@ -672,14 +672,14 @@ Vesa12_getpixel24:
|
||||
mov edi,eax ; x
|
||||
mov eax,ebx ; y
|
||||
lea edi,[edi+edi*2]
|
||||
mov ebx,[0xfe08]
|
||||
mov ebx,[BytesPerScanLine]
|
||||
mul ebx
|
||||
add edi,eax
|
||||
mov eax,edi
|
||||
shr eax,16
|
||||
call set_bank
|
||||
and edi,65535
|
||||
add edi,0xa0000
|
||||
add edi,VGABasePtr
|
||||
mov ecx,[edi]
|
||||
and ecx,255*256*256+255*256+255
|
||||
sti
|
||||
@ -691,7 +691,7 @@ Vesa12_getpixel32:
|
||||
mov edi,eax ; x
|
||||
mov eax,ebx ; y
|
||||
shl edi,2
|
||||
mov ebx,[0xfe08]
|
||||
mov ebx,[BytesPerScanLine]
|
||||
xor edx,edx
|
||||
mul ebx
|
||||
add edi,eax
|
||||
@ -699,7 +699,7 @@ Vesa12_getpixel32:
|
||||
shr eax,16
|
||||
call set_bank
|
||||
and edi,65535
|
||||
add edi,0xa0000
|
||||
add edi,VGABasePtr
|
||||
mov ecx,[edi]
|
||||
and ecx,255*256*256+255*256+255
|
||||
sti
|
||||
@ -736,18 +736,18 @@ vesa12_putimage:
|
||||
add ebx,[ecx-twdw+WDATA.box.top]
|
||||
push eax
|
||||
mov eax,ebx ; y
|
||||
mul dword [0xfe08]
|
||||
mul dword [BytesPerScanLine]
|
||||
pop ecx
|
||||
add eax,ecx ; x
|
||||
add eax,ecx
|
||||
add eax,ecx
|
||||
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ? - x start
|
||||
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x start
|
||||
jz pi2412
|
||||
add eax,ecx
|
||||
|
||||
pi2412:
|
||||
|
||||
add eax,[0xfe80]
|
||||
add eax,[LFBAddress]
|
||||
mov edi,eax
|
||||
|
||||
; x size
|
||||
@ -766,10 +766,10 @@ vesa12_putimage:
|
||||
cmp dword [eax+draw_data-CURRENT_TASK+RECT.top], 0
|
||||
jnz dbcblimitlset212
|
||||
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right]
|
||||
cmp ecx,[0xfe00]
|
||||
cmp ecx,[ScreenWidth]
|
||||
jnz dbcblimitlset212
|
||||
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom]
|
||||
cmp ecx,[0xfe04]
|
||||
cmp ecx,[ScreenHeight]
|
||||
jnz dbcblimitlset212
|
||||
pop ecx
|
||||
push 0
|
||||
@ -782,7 +782,7 @@ vesa12_putimage:
|
||||
|
||||
dbcblimitlno212:
|
||||
|
||||
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ?
|
||||
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ?
|
||||
jnz pi32bit12
|
||||
|
||||
pi24bit12:
|
||||
@ -794,7 +794,7 @@ vesa12_putimage:
|
||||
push ebx
|
||||
|
||||
mov edx,edi
|
||||
sub edx,[0xfe80]
|
||||
sub edx,[LFBAddress]
|
||||
mov ebx,3
|
||||
div ebx
|
||||
add edx,WinMapAddress
|
||||
@ -818,12 +818,12 @@ vesa12_putimage:
|
||||
push edi
|
||||
push eax
|
||||
mov eax,edi
|
||||
sub eax,[0xfe80]
|
||||
sub eax,[LFBAddress]
|
||||
shr eax,16
|
||||
call set_bank
|
||||
pop eax
|
||||
and edi,0xffff
|
||||
add edi,0xa0000
|
||||
add edi,VGABasePtr
|
||||
mov [edi],ax
|
||||
shr eax,16
|
||||
mov [edi+2],al
|
||||
@ -843,7 +843,7 @@ vesa12_putimage:
|
||||
pop ecx
|
||||
pop edi
|
||||
|
||||
add edi,[0xfe08]
|
||||
add edi,[BytesPerScanLine]
|
||||
add esi,[esp+32]
|
||||
dec ebx
|
||||
jnz newpi12
|
||||
@ -864,7 +864,7 @@ vesa12_putimage:
|
||||
push ebx
|
||||
|
||||
mov edx,edi
|
||||
sub edx,[0xfe80]
|
||||
sub edx,[LFBAddress]
|
||||
shr edx,2
|
||||
add edx,WinMapAddress
|
||||
mov ebx,[CURRENT_TASK]
|
||||
@ -887,12 +887,12 @@ vesa12_putimage:
|
||||
push edi
|
||||
push eax
|
||||
mov eax,edi
|
||||
sub eax,[0xfe80]
|
||||
sub eax,[LFBAddress]
|
||||
shr eax,16
|
||||
call set_bank
|
||||
pop eax
|
||||
and edi,0xffff
|
||||
mov [edi+0xa0000],eax
|
||||
mov [edi+VGABasePtr],eax
|
||||
pop edi
|
||||
|
||||
imp32no12:
|
||||
@ -909,7 +909,7 @@ vesa12_putimage:
|
||||
pop ecx
|
||||
pop edi
|
||||
|
||||
add edi,[0xfe08]
|
||||
add edi,[BytesPerScanLine]
|
||||
dec ebx
|
||||
jnz newpi3212
|
||||
|
||||
@ -923,7 +923,7 @@ vesa12_putimage:
|
||||
vesa12_read_screen_pixel:
|
||||
|
||||
and eax,0x3FFFFF
|
||||
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ?
|
||||
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ?
|
||||
jz v12rsp24
|
||||
mov edi,eax
|
||||
shl edi,2
|
||||
@ -931,7 +931,7 @@ vesa12_read_screen_pixel:
|
||||
shr eax,16
|
||||
call set_bank
|
||||
and edi,65535
|
||||
add edi,0xa0000
|
||||
add edi,VGABasePtr
|
||||
mov eax,[edi]
|
||||
and eax,0x00ffffff
|
||||
ret
|
||||
@ -942,7 +942,7 @@ vesa12_read_screen_pixel:
|
||||
shr eax,16
|
||||
call set_bank
|
||||
and edi,65535
|
||||
add edi,0xa0000
|
||||
add edi,VGABasePtr
|
||||
mov eax,[edi]
|
||||
and eax,0x00ffffff
|
||||
ret
|
||||
|
@ -17,12 +17,12 @@
|
||||
; If you're planning to write your own video driver I suggest
|
||||
; you replace the VESA12.INC file and see those instructions.
|
||||
|
||||
ScreenWidth equ 0xfe00
|
||||
ScreenHeight equ 0xfe04
|
||||
BytesPerScanLine equ 0xfe08
|
||||
LFBAddress equ 0xfe80
|
||||
ScreenBPP equ 0xfbf1
|
||||
WinMapAddress equ 0x460000
|
||||
;ScreenWidth equ 0xfe00
|
||||
;ScreenHeight equ 0xfe04
|
||||
;BytesPerScanLine equ 0xfe08
|
||||
;LFBAddress equ 0xfe80
|
||||
;ScreenBPP equ 0xfbf1
|
||||
;WinMapAddress equ 0x460000
|
||||
|
||||
|
||||
|
||||
@ -333,7 +333,7 @@ __sys_putpixel:
|
||||
mov [esp+32-8],ecx
|
||||
.noneg:
|
||||
; OK to set pixel
|
||||
call dword [0xe020] ; call the real put_pixel function
|
||||
call dword [PUTPIXEL] ; call the real put_pixel function
|
||||
.exit:
|
||||
popad
|
||||
|
||||
@ -930,7 +930,7 @@ vesa20_drawbackground_tiled:
|
||||
mov ebx,[esp+8] ; ebx:=B*3
|
||||
mul ebx ;
|
||||
add esi,eax ;
|
||||
mov eax,[esi+0x300000]
|
||||
mov eax,[esi+IMG_BACKGROUND]
|
||||
and eax,0xffffff
|
||||
|
||||
xchg edi, ebp
|
||||
@ -1066,7 +1066,7 @@ shl ecx,16
|
||||
mov cx,dx
|
||||
imul eax, [esp+8] ;8
|
||||
add esi,eax
|
||||
mov eax,[esi+0x300000]
|
||||
mov eax,[esi+IMG_BACKGROUND]
|
||||
push eax
|
||||
ror ecx,16
|
||||
xor eax,eax
|
||||
@ -1079,7 +1079,7 @@ div ebx
|
||||
cmp eax,5
|
||||
pop eax
|
||||
jb @f
|
||||
mov ebx,[esi+0x300000+3]
|
||||
mov ebx,[esi+IMG_BACKGROUND+3]
|
||||
call overlapping_of_points
|
||||
@@:
|
||||
push eax
|
||||
@ -1097,7 +1097,7 @@ jb @f
|
||||
mov ebx,[display_data-8]
|
||||
shl ebx,1
|
||||
add ebx,[display_data-8]
|
||||
add ebx,0x300000
|
||||
add ebx,IMG_BACKGROUND
|
||||
add ebx,esi
|
||||
mov ebx,[ebx]
|
||||
call overlapping_of_points
|
||||
|
@ -122,14 +122,14 @@ endg
|
||||
|
||||
checkVga_N13:
|
||||
|
||||
cmp [0xfe0c],dword 0x13
|
||||
cmp [SCR_MODE],dword 0x13
|
||||
jne @f
|
||||
|
||||
; cnvl:
|
||||
pushad
|
||||
cmp [EGA_counter],1
|
||||
je novesal
|
||||
mov ecx,[0xfb0a]
|
||||
mov ecx,[MOUSE_X]
|
||||
cmp ecx,[novesachecksum]
|
||||
jne novesal
|
||||
popad
|
||||
@ -151,7 +151,7 @@ checkVga_N13:
|
||||
sub eax,100
|
||||
imul eax,640*4
|
||||
add ecx,eax
|
||||
movzx eax,word [0xfb0a]
|
||||
movzx eax,word [MOUSE_X]
|
||||
cmp eax,160
|
||||
jge m13l1
|
||||
mov eax,160
|
||||
@ -163,9 +163,9 @@ checkVga_N13:
|
||||
sub eax,160
|
||||
shl eax,2
|
||||
add ecx,eax
|
||||
mov esi,[0xfe80]
|
||||
mov esi,[LFBAddress]
|
||||
add esi,ecx
|
||||
mov edi,0xa0000
|
||||
mov edi,VGABasePtr
|
||||
mov edx,200
|
||||
mov ecx,320
|
||||
cld
|
||||
@ -197,11 +197,11 @@ checkVga_N13:
|
||||
|
||||
VGA_drawbackground:
|
||||
; draw all
|
||||
cmp [0xfe0c],dword 0x12
|
||||
cmp [SCR_MODE],dword 0x12
|
||||
jne .end
|
||||
pushad
|
||||
mov esi,[0xfe80]
|
||||
mov edi,0xa0000
|
||||
mov esi,[LFBAddress]
|
||||
mov edi,VGABasePtr
|
||||
mov ebx,640/32 ; 640*480/(8*4)
|
||||
mov edx,480
|
||||
@@:
|
||||
@ -322,11 +322,11 @@ VGA_putpixel:
|
||||
lea ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5
|
||||
lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32)
|
||||
mov edi,edx
|
||||
add edi, [0xfe80] ; + LFB address
|
||||
add edi, [LFBAddress] ; + LFB address
|
||||
mov [edi], eax ; write to LFB for Vesa2.0
|
||||
shr edx,5 ; change BytesPerPixel to 1/8
|
||||
mov edi,edx
|
||||
add edi, 0x0a0000 ; address of pixel in VGA area
|
||||
add edi, VGABasePtr ; address of pixel in VGA area
|
||||
and ecx,0x07 ; bit no. (modulo 8)
|
||||
pushfd
|
||||
; edi = address, eax = 24bit colour, ecx = bit no. (modulo 8)
|
||||
@ -373,7 +373,7 @@ VGA_putpixel:
|
||||
VGA__putimage:
|
||||
; ecx = size [x|y]
|
||||
; edx = coordinates [x|y]
|
||||
cmp [0xfe0c],dword 0x12
|
||||
cmp [SCR_MODE],dword 0x12
|
||||
jne @f
|
||||
pushad
|
||||
rol edx,16
|
||||
@ -393,7 +393,7 @@ VGA_draw_bar:
|
||||
; ebx cy
|
||||
; ecx xe
|
||||
; edx ye
|
||||
cmp [0xfe0c],dword 0x12
|
||||
cmp [SCR_MODE],dword 0x12
|
||||
jne @f
|
||||
pushad
|
||||
sub ecx,eax
|
||||
@ -418,10 +418,10 @@ VGA_draw_bar_1:
|
||||
lea ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5
|
||||
lea ebx, [ebx+eax*4] ; + x*BytesPerPixel (Vesa2.0 32)
|
||||
mov esi,ebx
|
||||
add esi, [0xfe80] ; + LFB address
|
||||
add esi, [LFBAddress] ; + LFB address
|
||||
shr ebx,5 ; change BytesPerPixel to 1/8
|
||||
mov edi,ebx
|
||||
add edi, 0x0a0000 ; address of pixel in VGA area
|
||||
add edi, VGABasePtr ; address of pixel in VGA area
|
||||
mov ebx,ecx
|
||||
shr ebx,5
|
||||
inc ebx
|
||||
|
@ -16,7 +16,7 @@ endg
|
||||
|
||||
cmp eax,13 ; CALL VIDEOMODE DRIVER FUNCTIONS
|
||||
jne .no_vmode_drv_access
|
||||
pushd [0x0000fe00] [0x0000fe04]
|
||||
pushd [ScreenWidth] [ScreenHeight]
|
||||
popd [old_screen_height] [old_screen_width]
|
||||
or eax,-1 ; If driver is absent then eax does not change
|
||||
call 0x760100 ; Entry point of video driver
|
||||
@ -26,20 +26,20 @@ endg
|
||||
; mov [esp+28],edx
|
||||
mov eax,[old_screen_width]
|
||||
mov ebx,[old_screen_height]
|
||||
sub eax,[0x0000fe00]
|
||||
sub eax,[ScreenWidth]
|
||||
jnz @f
|
||||
sub ebx,[0x0000fe04]
|
||||
sub ebx,[ScreenHeight]
|
||||
jz .resolution_wasnt_changed
|
||||
jmp .lp1
|
||||
@@: sub ebx,[0x0000fe04]
|
||||
@@: sub ebx,[ScreenHeight]
|
||||
.lp1: sub [screen_workarea.right],eax
|
||||
sub [screen_workarea.bottom],ebx
|
||||
|
||||
call repos_windows
|
||||
mov eax, 0
|
||||
mov ebx, 0
|
||||
mov ecx, [0xfe00]
|
||||
mov edx, [0xfe04]
|
||||
mov ecx, [ScreenWidth]
|
||||
mov edx, [ScreenHeight]
|
||||
call calculatescreen
|
||||
|
||||
.resolution_wasnt_changed:
|
||||
|
Loading…
Reference in New Issue
Block a user