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