File system: new function 70.3 for write to the existing file
@panel: to match K0581 distro: SYSMETER -> GMON @numcalc: moved to the appropriate place in repository HeEd: added english variant NetSendC, NetSendS: added english variant + optimization pic4: changes in set background + optimization tetris, @rcher, board, sysxtree, vrr: new versions from K0581 distro bgitest: fixed small error + ability to set language via lang.inc c4: small correction in label height to match K0581 distro git-svn-id: svn://kolibrios.org@131 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1788,6 +1788,7 @@ fs_RamdiskRewrite:
|
|||||||
sub ebx, edx
|
sub ebx, edx
|
||||||
mov [edi+28], ebx
|
mov [edi+28], ebx
|
||||||
add esp, 20
|
add esp, 20
|
||||||
|
mov [esp+16], ebx
|
||||||
popad
|
popad
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
@@ -1797,6 +1798,7 @@ fs_RamdiskRewrite:
|
|||||||
sub ebx, edx
|
sub ebx, edx
|
||||||
mov [edi+28], ebx
|
mov [edi+28], ebx
|
||||||
add esp, 20
|
add esp, 20
|
||||||
|
mov [esp+16], ebx
|
||||||
popad
|
popad
|
||||||
push ERROR_DISK_FULL
|
push ERROR_DISK_FULL
|
||||||
pop eax
|
pop eax
|
||||||
@@ -1820,6 +1822,230 @@ fs_RamdiskRewrite:
|
|||||||
loop .read_symbols
|
loop .read_symbols
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
;----------------------------------------------------------------
|
||||||
|
;
|
||||||
|
; fs_RamdiskWrite - LFN variant for writing to sys floppy
|
||||||
|
;
|
||||||
|
; esi points to filename
|
||||||
|
; ebx pointer to 64-bit number = first wanted byte, 0+
|
||||||
|
; may be ebx=0 - start from first byte
|
||||||
|
; ecx number of bytes to write, 0+
|
||||||
|
; edx mem location to data
|
||||||
|
;
|
||||||
|
; ret ebx = bytes written (maybe 0)
|
||||||
|
; eax = 0 ok write or other = errormsg
|
||||||
|
;
|
||||||
|
;--------------------------------------------------------------
|
||||||
|
@@:
|
||||||
|
push ERROR_ACCESS_DENIED
|
||||||
|
fs_RamdiskWrite.ret0:
|
||||||
|
pop eax
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
|
||||||
|
fs_RamdiskWrite:
|
||||||
|
cmp byte [esi], 0
|
||||||
|
jz @b
|
||||||
|
pushad
|
||||||
|
call rd_find_lfn
|
||||||
|
jnc .found
|
||||||
|
popad
|
||||||
|
push ERROR_FILE_NOT_FOUND
|
||||||
|
jmp .ret0
|
||||||
|
.found:
|
||||||
|
; must not be directory
|
||||||
|
test byte [edi+11], 10h
|
||||||
|
jz @f
|
||||||
|
popad
|
||||||
|
push ERROR_ACCESS_DENIED
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
; FAT does not support files larger than 4GB
|
||||||
|
test ebx, ebx
|
||||||
|
jz .l1
|
||||||
|
cmp dword [ebx+4], 0
|
||||||
|
jz @f
|
||||||
|
.eof:
|
||||||
|
popad
|
||||||
|
push ERROR_END_OF_FILE
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
mov ebx, [ebx]
|
||||||
|
.l1:
|
||||||
|
; now edi points to direntry, ebx=start byte to write,
|
||||||
|
; ecx=number of bytes to write, edx=data pointer
|
||||||
|
call get_time_for_file
|
||||||
|
mov [edi+22], ax ; last write time
|
||||||
|
call get_date_for_file
|
||||||
|
mov [edi+24], ax ; last write date
|
||||||
|
mov [edi+18], ax ; last access date
|
||||||
|
|
||||||
|
; extend file if needed
|
||||||
|
add ecx, ebx
|
||||||
|
jc .eof ; FAT does not support files larger than 4GB
|
||||||
|
push 0 ; return value=0
|
||||||
|
cmp ecx, [edi+28]
|
||||||
|
jbe .length_ok
|
||||||
|
cmp ecx, ebx
|
||||||
|
jz .length_ok
|
||||||
|
call ramdisk_extend_file
|
||||||
|
jnc .length_ok
|
||||||
|
; ramdisk_extend_file can return two error codes: FAT table error or disk full.
|
||||||
|
; First case is fatal error, in second case we may write some data
|
||||||
|
mov [esp], eax
|
||||||
|
cmp al, ERROR_DISK_FULL
|
||||||
|
jz .disk_full
|
||||||
|
pop eax
|
||||||
|
mov [esp+28], eax
|
||||||
|
popad
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
.disk_full:
|
||||||
|
; correct number of bytes to write
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
cmp ecx, ebx
|
||||||
|
ja .length_ok
|
||||||
|
.ret:
|
||||||
|
pop eax
|
||||||
|
mov [esp+28], eax ; eax=return value
|
||||||
|
sub edx, [esp+20]
|
||||||
|
mov [esp+16], edx ; ebx=number of written bytes
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
.length_ok:
|
||||||
|
; now ebx=start pos, ecx=end pos, both lie inside file
|
||||||
|
sub ecx, ebx
|
||||||
|
jz .ret
|
||||||
|
movzx edi, word [edi+26] ; starting cluster
|
||||||
|
.write_loop:
|
||||||
|
sub ebx, 0x200
|
||||||
|
jae .next_cluster
|
||||||
|
push ecx
|
||||||
|
neg ebx
|
||||||
|
cmp ecx, ebx
|
||||||
|
jbe @f
|
||||||
|
mov ecx, ebx
|
||||||
|
@@:
|
||||||
|
mov eax, edi
|
||||||
|
shl eax, 9
|
||||||
|
add eax, 0x100000+31*512+0x200
|
||||||
|
sub eax, ebx
|
||||||
|
mov ebx, eax
|
||||||
|
mov eax, edx
|
||||||
|
call memmove
|
||||||
|
xor ebx, ebx
|
||||||
|
add edx, ecx
|
||||||
|
sub [esp], ecx
|
||||||
|
pop ecx
|
||||||
|
jz .ret
|
||||||
|
.next_cluster:
|
||||||
|
movzx edi, word [edi*2+0x280000]
|
||||||
|
jmp .write_loop
|
||||||
|
|
||||||
|
ramdisk_extend_file.zero_size:
|
||||||
|
xor eax, eax
|
||||||
|
jmp ramdisk_extend_file.start_extend
|
||||||
|
|
||||||
|
; extends file on ramdisk to given size, new data area is filled by 0
|
||||||
|
; in: edi->direntry, ecx=new size
|
||||||
|
; out: CF=0 => OK, eax destroyed
|
||||||
|
; CF=1 => error, eax=code (ERROR_FAT_TABLE or ERROR_DISK_FULL)
|
||||||
|
ramdisk_extend_file:
|
||||||
|
push ecx
|
||||||
|
; find the last cluster of file
|
||||||
|
movzx eax, word [edi+26] ; first cluster
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
jecxz .zero_size
|
||||||
|
@@:
|
||||||
|
sub ecx, 0x200
|
||||||
|
jbe @f
|
||||||
|
mov eax, [eax*2+0x280000]
|
||||||
|
and eax, 0xFFF
|
||||||
|
jz .fat_err
|
||||||
|
cmp eax, 0xFF8
|
||||||
|
jb @b
|
||||||
|
.fat_err:
|
||||||
|
pop ecx
|
||||||
|
push ERROR_FAT_TABLE
|
||||||
|
pop eax
|
||||||
|
stc
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
push eax
|
||||||
|
mov eax, [eax*2+0x280000]
|
||||||
|
and eax, 0xFFF
|
||||||
|
cmp eax, 0xFF8
|
||||||
|
pop eax
|
||||||
|
jb .fat_err
|
||||||
|
; set length to full number of sectors and make sure that last sector is zero-padded
|
||||||
|
sub [edi+28], ecx
|
||||||
|
push eax edi
|
||||||
|
mov edi, eax
|
||||||
|
shl edi, 9
|
||||||
|
lea edi, [edi+0x100000+31*512+0x200+ecx]
|
||||||
|
neg ecx
|
||||||
|
xor eax, eax
|
||||||
|
rep stosb
|
||||||
|
pop edi eax
|
||||||
|
.start_extend:
|
||||||
|
pop ecx
|
||||||
|
; now do extend
|
||||||
|
push edx esi
|
||||||
|
mov esi, 0x280000+2*2 ; start scan from cluster 2
|
||||||
|
mov edx, 2847 ; number of clusters to scan
|
||||||
|
.extend_loop:
|
||||||
|
cmp [edi+28], ecx
|
||||||
|
jae .extend_done
|
||||||
|
; add new sector
|
||||||
|
push ecx
|
||||||
|
mov ecx, edx
|
||||||
|
push edi
|
||||||
|
mov edi, esi
|
||||||
|
jecxz .disk_full
|
||||||
|
push eax
|
||||||
|
xor eax, eax
|
||||||
|
repnz scasw
|
||||||
|
pop eax
|
||||||
|
jnz .disk_full
|
||||||
|
mov word [edi-2], 0xFFF
|
||||||
|
mov esi, edi
|
||||||
|
mov edx, ecx
|
||||||
|
sub edi, 0x280000
|
||||||
|
shr edi, 1
|
||||||
|
dec edi ; now edi=new cluster
|
||||||
|
test eax, eax
|
||||||
|
jz .first_cluster
|
||||||
|
mov [0x280000+eax*2], di
|
||||||
|
jmp @f
|
||||||
|
.first_cluster:
|
||||||
|
pop eax ; eax->direntry
|
||||||
|
push eax
|
||||||
|
mov [eax+26], di
|
||||||
|
@@:
|
||||||
|
push edi
|
||||||
|
shl edi, 9
|
||||||
|
add edi, 0x100000+31*512
|
||||||
|
xor eax, eax
|
||||||
|
mov ecx, 512/4
|
||||||
|
rep stosd
|
||||||
|
pop eax ; eax=new cluster
|
||||||
|
pop edi ; edi->direntry
|
||||||
|
pop ecx ; ecx=required size
|
||||||
|
add dword [edi+28], 0x200
|
||||||
|
jmp .extend_loop
|
||||||
|
.extend_done:
|
||||||
|
mov [edi+28], ecx
|
||||||
|
pop esi edx
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
.disk_full:
|
||||||
|
pop edi ecx
|
||||||
|
pop esi edx
|
||||||
|
stc
|
||||||
|
push ERROR_DISK_FULL
|
||||||
|
pop eax
|
||||||
|
ret
|
||||||
|
|
||||||
fs_RamdiskGetFileInfo:
|
fs_RamdiskGetFileInfo:
|
||||||
cmp byte [esi], 0
|
cmp byte [esi], 0
|
||||||
jnz @f
|
jnz @f
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,7 @@ All registers except explicitly declared in the returned value,
|
|||||||
============== Function 0 - define and draw the window. ==============
|
============== Function 0 - define and draw the window. ==============
|
||||||
======================================================================
|
======================================================================
|
||||||
Defines an application window. Draws a frame of the window, header and
|
Defines an application window. Draws a frame of the window, header and
|
||||||
working area. For windows with skin defines standard buttons for close
|
working area. For skinned windows defines standard buttons for close
|
||||||
and minimize.
|
and minimize.
|
||||||
Parameters:
|
Parameters:
|
||||||
* eax = 0 - function number
|
* eax = 0 - function number
|
||||||
@@ -18,10 +18,10 @@ Parameters:
|
|||||||
* ecx = [coordinate on axis y]*65536 + [size on axis y]
|
* ecx = [coordinate on axis y]*65536 + [size on axis y]
|
||||||
* edx = 0xXYRRGGBB, where:
|
* edx = 0xXYRRGGBB, where:
|
||||||
* Y = style of the window:
|
* Y = style of the window:
|
||||||
* Y=0 - type I - window of the fixed size
|
* Y=0 - type I - fixed-size window
|
||||||
* Y=1 - only define window area, draw nothing
|
* Y=1 - only define window area, draw nothing
|
||||||
* Y=2 - type II - window of the variable size
|
* Y=2 - type II - variable-size window
|
||||||
* Y=3 - window with skin
|
* Y=3 - skinned window
|
||||||
* other possible values (from 4 up to 15) are reserved,
|
* other possible values (from 4 up to 15) are reserved,
|
||||||
function call with such Y is ignored
|
function call with such Y is ignored
|
||||||
* RR, GG, BB = accordingly red, green, blue components of a color
|
* RR, GG, BB = accordingly red, green, blue components of a color
|
||||||
@@ -61,11 +61,11 @@ Remarks:
|
|||||||
* The window must fit on the screen. If the transferred
|
* The window must fit on the screen. If the transferred
|
||||||
coordinates and sizes do not satisfy to this condition,
|
coordinates and sizes do not satisfy to this condition,
|
||||||
appropriate coordinate (or, probably, both) is considered as zero,
|
appropriate coordinate (or, probably, both) is considered as zero,
|
||||||
and if also it does not help, the appropriate size
|
and if it does not help too, the appropriate size
|
||||||
(or, probably, both) is installed in a size of the screen.
|
(or, probably, both) is installed in a size of the screen.
|
||||||
|
|
||||||
Further we shall designate xpos,ypos,xsize,ysize - values
|
Further let us designate xpos,ypos,xsize,ysize - values passed
|
||||||
transmitted in ebx,ecx. The coordinates are resulted concerning
|
in ebx,ecx. The coordinates are resulted concerning
|
||||||
the left upper corner of the window, which, thus, is set as (0,0),
|
the left upper corner of the window, which, thus, is set as (0,0),
|
||||||
coordinates of the right lower corner essence (xsize,ysize).
|
coordinates of the right lower corner essence (xsize,ysize).
|
||||||
* The sizes of the window are understood in sence of coordinates
|
* The sizes of the window are understood in sence of coordinates
|
||||||
@@ -289,7 +289,7 @@ Returned value:
|
|||||||
* function does not return value
|
* function does not return value
|
||||||
Remarks:
|
Remarks:
|
||||||
* Sizes of the button must be more than 0 and less than 0x8000.
|
* Sizes of the button must be more than 0 and less than 0x8000.
|
||||||
* For windows with skin definition of the window
|
* For skinned windows definition of the window
|
||||||
(call of 0th function) creates two standard buttons -
|
(call of 0th function) creates two standard buttons -
|
||||||
for close of the window with identifier 1 and
|
for close of the window with identifier 1 and
|
||||||
for minimize of the window with identifier 0xffff.
|
for minimize of the window with identifier 0xffff.
|
||||||
@@ -926,52 +926,66 @@ Remarks:
|
|||||||
process/thread by given slot.
|
process/thread by given slot.
|
||||||
|
|
||||||
======================================================================
|
======================================================================
|
||||||
====================== Function 18, subfunction 19 =====================
|
======== Function 18, subfunction 19 - get/set mouse features. =======
|
||||||
======================= Get/set mouse features. ======================
|
|
||||||
======================================================================
|
======================================================================
|
||||||
|
|
||||||
|
---------------- Subsubfunction 0 - get mouse speed. -----------------
|
||||||
Parameters:
|
Parameters:
|
||||||
* eax = 18 - function number
|
* eax = 18 - function number
|
||||||
* ebx = 19 - subfunction number
|
* ebx = 19 - subfunction number
|
||||||
* ecx = subsubfunction number
|
* ecx = 0 - subsubfunction number
|
||||||
|
Returned value:
|
||||||
|
* eax = current mouse speed
|
||||||
|
|
||||||
ecx = 0 - get mouse speed
|
---------------- Subsubfunction 1 - set mouse speed. -----------------
|
||||||
Returned value:
|
Parameters:
|
||||||
* eax = current mouse speed
|
* eax = 18 - function number
|
||||||
|
* ebx = 19 - subfunction number
|
||||||
|
* ecx = 1 - subsubfunction number
|
||||||
|
* edx = new value for speed
|
||||||
|
Returned value:
|
||||||
|
* function does not return value
|
||||||
|
|
||||||
ecx = 1 - set mouse speed
|
---------------- Subsubfunction 2 - get mouse delay. -----------------
|
||||||
edx = selected value of speed
|
Parameters:
|
||||||
Returned value:
|
* eax = 18 - function number
|
||||||
* function does not return value
|
* ebx = 19 - subfunction number
|
||||||
|
* ecx = 2 - subsubfunction number
|
||||||
|
Returned value:
|
||||||
|
* eax = current mouse delay
|
||||||
|
|
||||||
ecx = 2 - get mouse delay
|
---------------- Subsubfunction 3 - set mouse delay. -----------------
|
||||||
Returned value:
|
Parameters:
|
||||||
* eax = current mouse delay
|
* eax = 18 - function number
|
||||||
|
* ebx = 19 - subfunction number
|
||||||
ecx = 3 - set mouse delay
|
* ecx = 3 - subsubfunction number
|
||||||
edx = selected value of delay
|
* edx = new value for mouse delay
|
||||||
Returned value:
|
Returned value:
|
||||||
* function does not return value
|
* function does not return value
|
||||||
|
|
||||||
ecx = 4 - set mouse pointer position
|
|
||||||
edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
|
||||||
Returned value:
|
|
||||||
* function does not return value
|
|
||||||
|
|
||||||
|
----------- Subsubfunction 4 - set mouse pointer position. -----------
|
||||||
|
Parameters:
|
||||||
|
* eax = 18 - function number
|
||||||
|
* ebx = 19 - subfunction number
|
||||||
|
* ecx = 4 - subsubfunction number
|
||||||
|
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
||||||
|
Returned value:
|
||||||
|
* function does not return value
|
||||||
Remarks:
|
Remarks:
|
||||||
* Recommended speed of the mouse (in subfunction 1) from 1 up to 9.
|
* It is recommended to set speed of the mouse (in subsubfunction 1)
|
||||||
The installed value is not inspected by the code of a kernel, on this use
|
from 1 up to 9. The installed value is not inspected by the kernel
|
||||||
cautiously, at incorrect value the cursor can "freeze".
|
code, so set it carefully, at incorrect value the cursor
|
||||||
Speed of mouse can be regulated through the application SETUP.
|
can "freeze". Speed of the mouse can be regulated through the
|
||||||
* Recommended delay of the mouse (in subfunction 3) = 10. Lower value
|
application SETUP.
|
||||||
is not handled COM by mice. At the very large values the movement of
|
* Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
|
||||||
the mouse on 1 pixel is impossible and the cursor will jump
|
value is not handled by COM mice. At the very large values the
|
||||||
on the value of the installed speed (subfunction 1).
|
movement of the mouse on 1 pixel is impossible and the cursor will
|
||||||
The installed value is not inspected by the code of a kernel.
|
jump on the value of installed speed (subsubfunction 1). The
|
||||||
* In subfunction 4 the installed value is not inspected by
|
installed value is not inspected by the kernel code.
|
||||||
the code of a kernel. Before usage it is necessary to find out current
|
* The subsubfunction 4 does not check the passed value. Before
|
||||||
screen resolution and at installation of a position to watch,
|
its call find out current screen resolution (with function 14)
|
||||||
that the value of a position should do not fall outside
|
and check that the value of position is inside the limits of the
|
||||||
the limits the screen.
|
screen.
|
||||||
|
|
||||||
======================================================================
|
======================================================================
|
||||||
============ Function 19 - start application from ramdisk. ===========
|
============ Function 19 - start application from ramdisk. ===========
|
||||||
@@ -2134,11 +2148,11 @@ Remarks:
|
|||||||
* Structure of the color table is described in the standard
|
* Structure of the color table is described in the standard
|
||||||
include file 'macros.inc' as 'system_colors'; for example,
|
include file 'macros.inc' as 'system_colors'; for example,
|
||||||
it is possible to write:
|
it is possible to write:
|
||||||
sc system_colors ; variable declaration
|
sc system_colors ; variable declaration
|
||||||
... ; somewhere one must call
|
... ; somewhere one must call
|
||||||
; this function with ecx=sc
|
; this function with ecx=sc
|
||||||
mov ecx, [sc.work_button_text] ; read text color on
|
mov ecx, [sc.work_button_text] ; read text color on
|
||||||
; buttin in working area
|
; buttin in working area
|
||||||
* A program itself desides to use or not to use color table.
|
* A program itself desides to use or not to use color table.
|
||||||
For usage program must simply at calls to drawing functions select
|
For usage program must simply at calls to drawing functions select
|
||||||
color taken from the table.
|
color taken from the table.
|
||||||
@@ -2994,6 +3008,7 @@ Returned value:
|
|||||||
* eax = 0 - success, otherwise file system error code
|
* eax = 0 - success, otherwise file system error code
|
||||||
* ebx destroyed
|
* ebx destroyed
|
||||||
Remarks:
|
Remarks:
|
||||||
|
* This function is obsolete, use subfunction 3 of function 70.
|
||||||
* Ramdisk and floppies do not support this function, it is only
|
* Ramdisk and floppies do not support this function, it is only
|
||||||
for hard disks.
|
for hard disks.
|
||||||
* File must already exist (otherwise function returns 5, not found).
|
* File must already exist (otherwise function returns 5, not found).
|
||||||
@@ -3288,11 +3303,11 @@ Remarks:
|
|||||||
The data of the graphics screen (the memory area which displays
|
The data of the graphics screen (the memory area which displays
|
||||||
screen contents) are accessible to a program directly, without
|
screen contents) are accessible to a program directly, without
|
||||||
any system calls, through the selector gs:
|
any system calls, through the selector gs:
|
||||||
mov eax, [gs:0]
|
mov eax, [gs:0]
|
||||||
places in eax the first dword of the buffer, which contains
|
places in eax the first dword of the buffer, which contains
|
||||||
information on color of the left upper point (and, possibly, colors
|
information on color of the left upper point (and, possibly, colors
|
||||||
of several following).
|
of several following).
|
||||||
mov [gs:0], eax
|
mov [gs:0], eax
|
||||||
by work in VESA modes with LFB sets color of the left upper point
|
by work in VESA modes with LFB sets color of the left upper point
|
||||||
(and, possibly, colors of several following).
|
(and, possibly, colors of several following).
|
||||||
To interpret the data of graphics screen program needs to know
|
To interpret the data of graphics screen program needs to know
|
||||||
@@ -3854,7 +3869,7 @@ Remarks:
|
|||||||
and at arrival of new message the system will wait.
|
and at arrival of new message the system will wait.
|
||||||
For synchronization frame all work with the buffer by operations
|
For synchronization frame all work with the buffer by operations
|
||||||
lock/unlock
|
lock/unlock
|
||||||
neg [bufsize]
|
neg [bufsize]
|
||||||
* Data in the buffer are considered as array of items with variable
|
* Data in the buffer are considered as array of items with variable
|
||||||
length - messages. Format of a message is explained in
|
length - messages. Format of a message is explained in
|
||||||
general description.
|
general description.
|
||||||
@@ -4084,6 +4099,7 @@ Available subfunctions:
|
|||||||
* subfunction 0 - read file
|
* subfunction 0 - read file
|
||||||
* subfunction 1 - read folder
|
* subfunction 1 - read folder
|
||||||
* subfunction 2 - create/rewrite file
|
* subfunction 2 - create/rewrite file
|
||||||
|
* subfunction 3 - write to existing file
|
||||||
* subfunction 5 - get attributes of file/folder
|
* subfunction 5 - get attributes of file/folder
|
||||||
* subfunction 6 - set attributes of file/folder
|
* subfunction 6 - set attributes of file/folder
|
||||||
* subfunction 7 - start application
|
* subfunction 7 - start application
|
||||||
@@ -4243,6 +4259,35 @@ Remarks:
|
|||||||
write as many as can and then return error code 8.
|
write as many as can and then return error code 8.
|
||||||
* The function is not supported for CD (returns error code 2).
|
* The function is not supported for CD (returns error code 2).
|
||||||
|
|
||||||
|
======================================================================
|
||||||
|
===================== Function 70, subfunction 3 =====================
|
||||||
|
=========== Write to existing file with long names support. ==========
|
||||||
|
======================================================================
|
||||||
|
Parameters:
|
||||||
|
* eax = 70 - function number
|
||||||
|
* ebx = pointer to the information structure
|
||||||
|
Format of the information structure:
|
||||||
|
* +0: dword: 3 = subfunction number
|
||||||
|
* +4: dword: file offset (in bytes)
|
||||||
|
* +8: dword: high dword of offset (must be 0 for FAT)
|
||||||
|
* +12 = +0xC: dword: number of bytes to write
|
||||||
|
* +16 = +0x10: dword: pointer to data
|
||||||
|
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
|
||||||
|
given in the general description
|
||||||
|
or
|
||||||
|
* +20 = +0x14: db 0
|
||||||
|
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
|
||||||
|
Returned value:
|
||||||
|
* eax = 0 - success, otherwise file system error code
|
||||||
|
* ebx = number of written bytes (possibly 0)
|
||||||
|
Remarks:
|
||||||
|
* The file must already exist, otherwise function returns eax=5.
|
||||||
|
* The only result of write 0 bytes is update in the file attributes
|
||||||
|
date/time of modification and access to the current date/time.
|
||||||
|
* If beginning and/or ending position is greater than file size
|
||||||
|
(except for the previous case), the file is expanded to needed
|
||||||
|
size with zero characters.
|
||||||
|
|
||||||
======================================================================
|
======================================================================
|
||||||
==== Function 70, subfunction 5 - get information on file/folder. ====
|
==== Function 70, subfunction 5 - get information on file/folder. ====
|
||||||
======================================================================
|
======================================================================
|
||||||
@@ -4420,4 +4465,3 @@ Application start functions can return also following errors:
|
|||||||
* 30 = 0x1E = not enough memory
|
* 30 = 0x1E = not enough memory
|
||||||
* 31 = 0x1F = file is not executable
|
* 31 = 0x1F = file is not executable
|
||||||
* 32 = 0x20 = too many processes
|
* 32 = 0x20 = too many processes
|
||||||
|
|
||||||
|
@@ -63,9 +63,9 @@ rdfs2_1:
|
|||||||
fdc_status_error_2:
|
fdc_status_error_2:
|
||||||
pop ecx ebx eax
|
pop ecx ebx eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
floppy_fileread:
|
floppy_fileread:
|
||||||
;----------------------------------------------------------------
|
;----------------------------------------------------------------
|
||||||
@@ -115,7 +115,7 @@ fr_do_1:
|
|||||||
ret
|
ret
|
||||||
fdc_status_error_1:
|
fdc_status_error_1:
|
||||||
mov [flp_status],0
|
mov [flp_status],0
|
||||||
mov eax,10
|
mov eax,10
|
||||||
mov ebx,-1
|
mov ebx,-1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ frfl8_1:
|
|||||||
sub [esp+24],dword 512
|
sub [esp+24],dword 512
|
||||||
jmp frnew_1
|
jmp frnew_1
|
||||||
|
|
||||||
read_chs_sector:
|
read_chs_sector:
|
||||||
call calculate_chs
|
call calculate_chs
|
||||||
call ReadSectWithRetr
|
call ReadSectWithRetr
|
||||||
ret
|
ret
|
||||||
@@ -273,7 +273,7 @@ read_flp_root:
|
|||||||
je unnecessary_root_read
|
je unnecessary_root_read
|
||||||
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Head],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Head],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov edi,0x8000
|
mov edi,0x8000
|
||||||
call SeekTrack
|
call SeekTrack
|
||||||
read_flp_root_1:
|
read_flp_root_1:
|
||||||
@@ -302,7 +302,7 @@ read_flp_fat:
|
|||||||
je unnecessary_flp_fat
|
je unnecessary_flp_fat
|
||||||
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov edi,0x8000
|
mov edi,0x8000
|
||||||
call SeekTrack
|
call SeekTrack
|
||||||
read_flp_fat_1:
|
read_flp_fat_1:
|
||||||
@@ -358,7 +358,7 @@ calculatefatchain_flp:
|
|||||||
mov dword [edi],ecx
|
mov dword [edi],ecx
|
||||||
add edi,4
|
add edi,4
|
||||||
mov dword [edi],edx
|
mov dword [edi],edx
|
||||||
add edi,4
|
add edi,4
|
||||||
add esi,12
|
add esi,12
|
||||||
|
|
||||||
cmp edi,0x282000+2856*2 ;2849 clusters
|
cmp edi,0x282000+2856*2 ;2849 clusters
|
||||||
@@ -366,12 +366,12 @@ calculatefatchain_flp:
|
|||||||
|
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
|
||||||
check_label:
|
check_label:
|
||||||
pushad
|
pushad
|
||||||
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Sector],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Sector],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
call SetUserInterrupts
|
call SetUserInterrupts
|
||||||
call FDDMotorON
|
call FDDMotorON
|
||||||
call RecalibrateFDD
|
call RecalibrateFDD
|
||||||
@@ -382,12 +382,12 @@ check_label:
|
|||||||
jne fdc_status_error
|
jne fdc_status_error
|
||||||
call ReadSectWithRetr
|
call ReadSectWithRetr
|
||||||
cmp [FDC_Status],0
|
cmp [FDC_Status],0
|
||||||
jne fdc_status_error
|
jne fdc_status_error
|
||||||
mov esi,flp_label
|
mov esi,flp_label
|
||||||
mov edi,0xD000+39
|
mov edi,0xD000+39
|
||||||
mov ecx,15
|
mov ecx,15
|
||||||
cld
|
cld
|
||||||
rep cmpsb
|
rep cmpsb
|
||||||
je same_label
|
je same_label
|
||||||
mov [root_read],0
|
mov [root_read],0
|
||||||
mov [flp_fat],0
|
mov [flp_fat],0
|
||||||
@@ -412,7 +412,7 @@ save_flp_root:
|
|||||||
je unnecessary_root_save
|
je unnecessary_root_save
|
||||||
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Head],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Head],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov esi,0x8000
|
mov esi,0x8000
|
||||||
call SeekTrack
|
call SeekTrack
|
||||||
save_flp_root_1:
|
save_flp_root_1:
|
||||||
@@ -430,7 +430,7 @@ unnecessary_root_save:
|
|||||||
mov [fdc_irq_func],fdc_null
|
mov [fdc_irq_func],fdc_null
|
||||||
popa
|
popa
|
||||||
ret
|
ret
|
||||||
|
|
||||||
save_flp_fat:
|
save_flp_fat:
|
||||||
pusha
|
pusha
|
||||||
call check_label
|
call check_label
|
||||||
@@ -441,7 +441,7 @@ save_flp_fat:
|
|||||||
call restorefatchain_flp
|
call restorefatchain_flp
|
||||||
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov esi,0x8000
|
mov esi,0x8000
|
||||||
call SeekTrack
|
call SeekTrack
|
||||||
save_flp_fat_1:
|
save_flp_fat_1:
|
||||||
@@ -467,7 +467,7 @@ unnecessary_flp_fat_save:
|
|||||||
popa
|
popa
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
restorefatchain_flp: ; restore fat chain
|
restorefatchain_flp: ; restore fat chain
|
||||||
pushad
|
pushad
|
||||||
|
|
||||||
@@ -563,7 +563,7 @@ fifoundd_1:
|
|||||||
mov ebx,[path_pointer_flp]
|
mov ebx,[path_pointer_flp]
|
||||||
add ebx,36
|
add ebx,36
|
||||||
call get_cluster_of_a_path_flp
|
call get_cluster_of_a_path_flp
|
||||||
jc frnoreadd_1_1
|
jc frnoreadd_1_1
|
||||||
mov edi,ebx
|
mov edi,ebx
|
||||||
add edi,11
|
add edi,11
|
||||||
jmp fifoundd_2_1
|
jmp fifoundd_2_1
|
||||||
@@ -617,7 +617,7 @@ floppy_filesave:
|
|||||||
; edi pointer to path /fd/1/...... - for all files in nested directories
|
; edi pointer to path /fd/1/...... - for all files in nested directories
|
||||||
;
|
;
|
||||||
; output : eax = 0 - ok
|
; output : eax = 0 - ok
|
||||||
; 5 - file not found / directory not found
|
; 5 - file not found / directory not found
|
||||||
; 8 - disk full
|
; 8 - disk full
|
||||||
; 10 - access denied
|
; 10 - access denied
|
||||||
;-----------------------------------------------------------
|
;-----------------------------------------------------------
|
||||||
@@ -644,10 +644,10 @@ fsdel_1:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
fdc_status_error_6:
|
fdc_status_error_6:
|
||||||
popa
|
popa
|
||||||
add esp,32
|
add esp,32
|
||||||
jmp fdc_status_error_1
|
jmp fdc_status_error_1
|
||||||
|
|
||||||
rd_do_save_1:
|
rd_do_save_1:
|
||||||
push eax ebx ecx edx esi edi
|
push eax ebx ecx edx esi edi
|
||||||
call read_flp_fat
|
call read_flp_fat
|
||||||
@@ -749,7 +749,7 @@ fifoundds_4:
|
|||||||
mov ebx,1 ; first cluster
|
mov ebx,1 ; first cluster
|
||||||
cmp [save_root_flag],0
|
cmp [save_root_flag],0
|
||||||
jne frnewds_1
|
jne frnewds_1
|
||||||
call frnewds_2
|
call frnewds_2
|
||||||
pusha
|
pusha
|
||||||
call WriteSectWithRetr
|
call WriteSectWithRetr
|
||||||
popa
|
popa
|
||||||
@@ -811,7 +811,7 @@ frnoreadds_1:
|
|||||||
|
|
||||||
fdc_status_error_7_1:
|
fdc_status_error_7_1:
|
||||||
cmp [FDC_Status],0
|
cmp [FDC_Status],0
|
||||||
je fdc_status_error_8
|
je fdc_status_error_8
|
||||||
fdc_status_error_7:
|
fdc_status_error_7:
|
||||||
pop edi esi edx ecx ebx eax
|
pop edi esi edx ecx ebx eax
|
||||||
add esp,32
|
add esp,32
|
||||||
@@ -821,10 +821,10 @@ save_chs_sector:
|
|||||||
call calculate_chs
|
call calculate_chs
|
||||||
call WriteSectWithRetr
|
call WriteSectWithRetr
|
||||||
ret
|
ret
|
||||||
|
|
||||||
calculate_chs:
|
calculate_chs:
|
||||||
mov bl,[FDD_Track]
|
mov bl,[FDD_Track]
|
||||||
mov [old_track],bl
|
mov [old_track],bl
|
||||||
mov ebx,18
|
mov ebx,18
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
div ebx
|
div ebx
|
||||||
@@ -846,7 +846,7 @@ no_head_2:
|
|||||||
no_seek_track_1:
|
no_seek_track_1:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
get_cluster_of_a_path_flp:
|
get_cluster_of_a_path_flp:
|
||||||
;---------------------------------------------------------
|
;---------------------------------------------------------
|
||||||
; input : EBX = pointer to a path string
|
; input : EBX = pointer to a path string
|
||||||
@@ -892,7 +892,7 @@ directory_not_found_flp:
|
|||||||
pop edx
|
pop edx
|
||||||
stc ; errors occour
|
stc ; errors occour
|
||||||
ret
|
ret
|
||||||
|
|
||||||
analyze_directory_flp:
|
analyze_directory_flp:
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
; input : EAX = first cluster of the directory
|
; input : EAX = first cluster of the directory
|
||||||
@@ -908,8 +908,8 @@ analyze_directory_flp:
|
|||||||
push edx
|
push edx
|
||||||
push esi
|
push esi
|
||||||
push edi
|
push edi
|
||||||
|
|
||||||
|
|
||||||
adr56_flp:
|
adr56_flp:
|
||||||
mov [clust_tmp_flp],eax
|
mov [clust_tmp_flp],eax
|
||||||
add eax,31
|
add eax,31
|
||||||
@@ -921,7 +921,7 @@ adr56_flp:
|
|||||||
|
|
||||||
mov ecx,512/32
|
mov ecx,512/32
|
||||||
mov ebx,0xD000
|
mov ebx,0xD000
|
||||||
|
|
||||||
adr1_analyze_flp:
|
adr1_analyze_flp:
|
||||||
mov esi,edx ;[esp+16]
|
mov esi,edx ;[esp+16]
|
||||||
mov edi,ebx
|
mov edi,ebx
|
||||||
@@ -931,10 +931,10 @@ adr1_analyze_flp:
|
|||||||
rep cmpsb
|
rep cmpsb
|
||||||
pop ecx
|
pop ecx
|
||||||
je found_file_analyze_flp
|
je found_file_analyze_flp
|
||||||
|
|
||||||
add ebx,32
|
add ebx,32
|
||||||
loop adr1_analyze_flp
|
loop 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,0x282000
|
||||||
@@ -942,7 +942,7 @@ adr1_analyze_flp:
|
|||||||
and eax,4095
|
and eax,4095
|
||||||
cmp eax,0x0ff8
|
cmp eax,0x0ff8
|
||||||
jb adr56_flp
|
jb adr56_flp
|
||||||
not_found_file_analyze_flp:
|
not_found_file_analyze_flp:
|
||||||
pop edi
|
pop edi
|
||||||
pop esi
|
pop esi
|
||||||
pop edx
|
pop edx
|
||||||
@@ -950,7 +950,7 @@ not_found_file_analyze_flp:
|
|||||||
add esp,4
|
add esp,4
|
||||||
stc ;file not found
|
stc ;file not found
|
||||||
ret
|
ret
|
||||||
|
|
||||||
found_file_analyze_flp:
|
found_file_analyze_flp:
|
||||||
pop edi
|
pop edi
|
||||||
pop esi
|
pop esi
|
||||||
@@ -959,8 +959,8 @@ found_file_analyze_flp:
|
|||||||
add esp,4
|
add esp,4
|
||||||
clc ;file found
|
clc ;file found
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
analyze_directory_to_write_flp:
|
analyze_directory_to_write_flp:
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
; input : EAX = first cluster of the directory
|
; input : EAX = first cluster of the directory
|
||||||
@@ -970,33 +970,33 @@ analyze_directory_to_write_flp:
|
|||||||
; ECX,EDX,EDI,EDI not changed
|
; ECX,EDX,EDI,EDI not changed
|
||||||
; IF CARRY=1
|
; IF CARRY=1
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
|
|
||||||
push ecx
|
push ecx
|
||||||
push edx
|
push edx
|
||||||
push esi
|
push esi
|
||||||
|
|
||||||
adr561:
|
adr561:
|
||||||
mov [clust_tmp_flp],eax
|
mov [clust_tmp_flp],eax
|
||||||
add eax,31
|
add eax,31
|
||||||
pusha
|
pusha
|
||||||
call read_chs_sector
|
call read_chs_sector
|
||||||
popa
|
popa
|
||||||
cmp [FDC_Status],0
|
cmp [FDC_Status],0
|
||||||
jne error_found_file_analyze1
|
jne error_found_file_analyze1
|
||||||
|
|
||||||
mov ecx,512/32
|
mov ecx,512/32
|
||||||
mov ebx,0xD000
|
mov ebx,0xD000
|
||||||
|
|
||||||
adr1_analyze1:
|
adr1_analyze1:
|
||||||
cmp byte [ebx],0x00
|
cmp byte [ebx],0x00
|
||||||
je found_file_analyze1
|
je found_file_analyze1
|
||||||
cmp byte [ebx],0xe5
|
cmp byte [ebx],0xe5
|
||||||
je found_file_analyze1
|
je found_file_analyze1
|
||||||
|
|
||||||
avanti:
|
avanti:
|
||||||
add ebx,32
|
add ebx,32
|
||||||
loop adr1_analyze1
|
loop adr1_analyze1
|
||||||
|
|
||||||
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,0x282000
|
||||||
@@ -1004,13 +1004,13 @@ avanti:
|
|||||||
and eax,4095
|
and eax,4095
|
||||||
cmp eax,0x0ff8
|
cmp eax,0x0ff8
|
||||||
jb adr561
|
jb adr561
|
||||||
|
|
||||||
call get_free_FAT ;this block of code add a new cluster
|
call get_free_FAT ;this block of code add a new cluster
|
||||||
;for the directory because the directory
|
;for the directory because the directory
|
||||||
;is full
|
;is full
|
||||||
|
|
||||||
mov [edi],word 0x0fff
|
mov [edi],word 0x0fff
|
||||||
|
|
||||||
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,0x282000
|
||||||
@@ -1028,14 +1028,14 @@ avanti:
|
|||||||
mov eax,edi
|
mov eax,edi
|
||||||
add eax,31
|
add eax,31
|
||||||
pusha
|
pusha
|
||||||
call save_chs_sector
|
call save_chs_sector
|
||||||
popa
|
popa
|
||||||
cmp [FDC_Status],0
|
cmp [FDC_Status],0
|
||||||
jne error_found_file_analyze1
|
jne error_found_file_analyze1
|
||||||
mov ebx,0xD000
|
mov ebx,0xD000
|
||||||
|
|
||||||
found_file_analyze1:
|
found_file_analyze1:
|
||||||
|
|
||||||
pop esi
|
pop esi
|
||||||
pop edx
|
pop edx
|
||||||
pop ecx
|
pop ecx
|
||||||
@@ -1047,15 +1047,15 @@ error_found_file_analyze1:
|
|||||||
pop edx
|
pop edx
|
||||||
pop ecx
|
pop ecx
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
|
|
||||||
get_free_FAT_flp:
|
get_free_FAT_flp:
|
||||||
;------------------------------------------
|
;------------------------------------------
|
||||||
; input : EAX = # cluster for start the searching
|
; input : EAX = # cluster for start the searching
|
||||||
; output : EAX = # first cluster found free
|
; output : EAX = # first cluster found free
|
||||||
;-------------------------------------------
|
;-------------------------------------------
|
||||||
push ebx
|
push ebx
|
||||||
|
|
||||||
mov ebx,1
|
mov ebx,1
|
||||||
check_new_flp:
|
check_new_flp:
|
||||||
add ebx,1
|
add ebx,1
|
||||||
@@ -1265,6 +1265,11 @@ fd_find_lfn:
|
|||||||
ret
|
ret
|
||||||
.found:
|
.found:
|
||||||
mov eax, [esp+8]
|
mov eax, [esp+8]
|
||||||
|
add eax, 31
|
||||||
|
cmp dword [esp], flp_root_next
|
||||||
|
jnz @f
|
||||||
|
add eax, -31+19
|
||||||
|
@@:
|
||||||
add esp, 16 ; CF=0
|
add esp, 16 ; CF=0
|
||||||
pop esi
|
pop esi
|
||||||
ret
|
ret
|
||||||
@@ -1915,6 +1920,304 @@ fs_FloppyRewrite:
|
|||||||
pop edi ecx
|
pop edi ecx
|
||||||
jmp .ret
|
jmp .ret
|
||||||
|
|
||||||
|
;----------------------------------------------------------------
|
||||||
|
;
|
||||||
|
; fs_FloppyWrite - LFN variant for writing to floppy
|
||||||
|
;
|
||||||
|
; esi points to filename
|
||||||
|
; ebx pointer to 64-bit number = first wanted byte, 0+
|
||||||
|
; may be ebx=0 - start from first byte
|
||||||
|
; ecx number of bytes to write, 0+
|
||||||
|
; edx mem location to data
|
||||||
|
;
|
||||||
|
; ret ebx = bytes written (maybe 0)
|
||||||
|
; eax = 0 ok write or other = errormsg
|
||||||
|
;
|
||||||
|
;--------------------------------------------------------------
|
||||||
|
|
||||||
|
@@:
|
||||||
|
push ERROR_ACCESS_DENIED
|
||||||
|
fs_FloppyWrite.ret0:
|
||||||
|
pop eax
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
|
||||||
|
fs_FloppyWrite.ret11:
|
||||||
|
push 11
|
||||||
|
jmp fs_FloppyWrite.ret0
|
||||||
|
|
||||||
|
fs_FloppyWrite:
|
||||||
|
cmp byte [esi], 0
|
||||||
|
jz @b
|
||||||
|
call read_flp_fat
|
||||||
|
cmp [FDC_Status], 0
|
||||||
|
jnz .ret11
|
||||||
|
pushad
|
||||||
|
call fd_find_lfn
|
||||||
|
jnc .found
|
||||||
|
popad
|
||||||
|
push ERROR_FILE_NOT_FOUND
|
||||||
|
jmp .ret0
|
||||||
|
.found:
|
||||||
|
; FAT does not support files larger than 4GB
|
||||||
|
test ebx, ebx
|
||||||
|
jz .l1
|
||||||
|
cmp dword [ebx+4], 0
|
||||||
|
jz @f
|
||||||
|
.eof:
|
||||||
|
popad
|
||||||
|
push ERROR_END_OF_FILE
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
mov ebx, [ebx]
|
||||||
|
.l1:
|
||||||
|
; now edi points to direntry, ebx=start byte to write,
|
||||||
|
; ecx=number of bytes to write, edx=data pointer
|
||||||
|
|
||||||
|
; extend file if needed
|
||||||
|
add ecx, ebx
|
||||||
|
jc .eof ; FAT does not support files larger than 4GB
|
||||||
|
push eax ; save directory cluster
|
||||||
|
push 0 ; return value=0
|
||||||
|
|
||||||
|
call get_time_for_file
|
||||||
|
mov [edi+22], ax ; last write time
|
||||||
|
call get_date_for_file
|
||||||
|
mov [edi+24], ax ; last write date
|
||||||
|
mov [edi+18], ax ; last access date
|
||||||
|
|
||||||
|
push dword [edi+28] ; save current file size
|
||||||
|
cmp ecx, [edi+28]
|
||||||
|
jbe .length_ok
|
||||||
|
cmp ecx, ebx
|
||||||
|
jz .length_ok
|
||||||
|
call floppy_extend_file
|
||||||
|
jnc .length_ok
|
||||||
|
mov [esp+4], eax
|
||||||
|
; floppy_extend_file can return two error codes: FAT table error or disk full.
|
||||||
|
; First case is fatal error, in second case we may write some data
|
||||||
|
cmp al, ERROR_DISK_FULL
|
||||||
|
jz .disk_full
|
||||||
|
pop eax
|
||||||
|
pop eax
|
||||||
|
mov [esp+4+28], eax
|
||||||
|
pop eax
|
||||||
|
popad
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
.disk_full:
|
||||||
|
; correct number of bytes to write
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
cmp ecx, ebx
|
||||||
|
ja .length_ok
|
||||||
|
.ret:
|
||||||
|
pop eax
|
||||||
|
pop eax
|
||||||
|
mov [esp+4+28], eax ; eax=return value
|
||||||
|
pop eax
|
||||||
|
sub edx, [esp+20]
|
||||||
|
mov [esp+16], edx ; ebx=number of written bytes
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
.length_ok:
|
||||||
|
; save FAT & directory
|
||||||
|
; note that directory must be saved first because save_flp_fat uses buffer at 0xD000
|
||||||
|
mov esi, [edi+28]
|
||||||
|
movzx edi, word [edi+26] ; starting cluster
|
||||||
|
mov eax, [esp+8]
|
||||||
|
pusha
|
||||||
|
call save_chs_sector
|
||||||
|
popa
|
||||||
|
cmp [FDC_Status], 0
|
||||||
|
jnz .device_err
|
||||||
|
call save_flp_fat
|
||||||
|
cmp [FDC_Status], 0
|
||||||
|
jz @f
|
||||||
|
.device_err:
|
||||||
|
mov byte [esp+4], 11
|
||||||
|
jmp .ret
|
||||||
|
@@:
|
||||||
|
|
||||||
|
; now ebx=start pos, ecx=end pos, both lie inside file
|
||||||
|
sub ecx, ebx
|
||||||
|
jz .ret
|
||||||
|
call SetUserInterrupts
|
||||||
|
.write_loop:
|
||||||
|
lea eax, [edi+31] ; current sector
|
||||||
|
; get length of data in current sector
|
||||||
|
push ecx
|
||||||
|
sub ebx, 0x200
|
||||||
|
jb .hasdata
|
||||||
|
neg ebx
|
||||||
|
xor ecx, ecx
|
||||||
|
jmp @f
|
||||||
|
.hasdata:
|
||||||
|
neg ebx
|
||||||
|
cmp ecx, ebx
|
||||||
|
jbe @f
|
||||||
|
mov ecx, ebx
|
||||||
|
@@:
|
||||||
|
; load sector if needed
|
||||||
|
cmp dword [esp+4], 0 ; we don't need to read uninitialized data
|
||||||
|
jz .noread
|
||||||
|
cmp ecx, 0x200 ; we don't need to read sector if it is fully rewritten
|
||||||
|
jz .noread
|
||||||
|
cmp ecx, esi ; (same for the last sector)
|
||||||
|
jz .noread
|
||||||
|
pusha
|
||||||
|
call read_chs_sector
|
||||||
|
popa
|
||||||
|
cmp [FDC_Status], 0
|
||||||
|
jz @f
|
||||||
|
.device_err2:
|
||||||
|
pop ecx
|
||||||
|
jmp .device_err
|
||||||
|
@@:
|
||||||
|
.noread:
|
||||||
|
; zero uninitialized data if file was extended (because floppy_extend_file does not this)
|
||||||
|
push eax ecx edi
|
||||||
|
xor eax, eax
|
||||||
|
mov ecx, 0x200
|
||||||
|
sub ecx, [esp+4+12]
|
||||||
|
jbe @f
|
||||||
|
mov edi, 0xD000
|
||||||
|
add edi, [esp+4+12]
|
||||||
|
rep stosb
|
||||||
|
@@:
|
||||||
|
; zero uninitialized data in the last sector
|
||||||
|
mov ecx, 0x200
|
||||||
|
sub ecx, esi
|
||||||
|
jbe @f
|
||||||
|
mov edi, 0xD000
|
||||||
|
add edi, esi
|
||||||
|
rep stosb
|
||||||
|
@@:
|
||||||
|
pop edi ecx eax
|
||||||
|
; copy new data
|
||||||
|
push eax
|
||||||
|
mov eax, edx
|
||||||
|
neg ebx
|
||||||
|
jecxz @f
|
||||||
|
add ebx, 0xD000+0x200
|
||||||
|
call memmove
|
||||||
|
xor ebx, ebx
|
||||||
|
@@:
|
||||||
|
pop eax
|
||||||
|
; save sector
|
||||||
|
pusha
|
||||||
|
call save_chs_sector
|
||||||
|
popa
|
||||||
|
cmp [FDC_Status], 0
|
||||||
|
jnz .device_err2
|
||||||
|
add edx, ecx
|
||||||
|
sub [esp], ecx
|
||||||
|
pop ecx
|
||||||
|
jz .done
|
||||||
|
.next_cluster:
|
||||||
|
movzx edi, word [edi*2+0x282000]
|
||||||
|
sub esi, 0x200
|
||||||
|
jae @f
|
||||||
|
xor esi, esi
|
||||||
|
@@:
|
||||||
|
sub dword [esp], 0x200
|
||||||
|
jae .write_loop
|
||||||
|
and dword [esp], 0
|
||||||
|
jmp .write_loop
|
||||||
|
.done:
|
||||||
|
mov [fdc_irq_func], fdc_null
|
||||||
|
jmp .ret
|
||||||
|
|
||||||
|
floppy_extend_file.zero_size:
|
||||||
|
xor eax, eax
|
||||||
|
jmp floppy_extend_file.start_extend
|
||||||
|
|
||||||
|
; extends file on floppy to given size (new data area is undefined)
|
||||||
|
; in: edi->direntry, ecx=new size
|
||||||
|
; out: CF=0 => OK, eax destroyed
|
||||||
|
; CF=1 => error, eax=code (ERROR_FAT_TABLE or ERROR_DISK_FULL)
|
||||||
|
floppy_extend_file:
|
||||||
|
push ecx
|
||||||
|
; find the last cluster of file
|
||||||
|
movzx eax, word [edi+26] ; first cluster
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
jecxz .zero_size
|
||||||
|
@@:
|
||||||
|
sub ecx, 0x200
|
||||||
|
jbe @f
|
||||||
|
mov eax, [eax*2+0x282000]
|
||||||
|
and eax, 0xFFF
|
||||||
|
jz .fat_err
|
||||||
|
cmp eax, 0xFF8
|
||||||
|
jb @b
|
||||||
|
.fat_err:
|
||||||
|
pop ecx
|
||||||
|
push ERROR_FAT_TABLE
|
||||||
|
pop eax
|
||||||
|
stc
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
push eax
|
||||||
|
mov eax, [eax*2+0x282000]
|
||||||
|
and eax, 0xFFF
|
||||||
|
cmp eax, 0xFF8
|
||||||
|
pop eax
|
||||||
|
jb .fat_err
|
||||||
|
; set length to full number of sectors
|
||||||
|
sub [edi+28], ecx
|
||||||
|
.start_extend:
|
||||||
|
pop ecx
|
||||||
|
; now do extend
|
||||||
|
push edx esi
|
||||||
|
mov esi, 0x282000+2*2 ; start scan from cluster 2
|
||||||
|
mov edx, 2847 ; number of clusters to scan
|
||||||
|
.extend_loop:
|
||||||
|
cmp [edi+28], ecx
|
||||||
|
jae .extend_done
|
||||||
|
; add new sector
|
||||||
|
push ecx
|
||||||
|
push edi
|
||||||
|
.scan:
|
||||||
|
mov ecx, edx
|
||||||
|
mov edi, esi
|
||||||
|
jecxz .disk_full
|
||||||
|
push eax
|
||||||
|
xor eax, eax
|
||||||
|
repnz scasw
|
||||||
|
pop eax
|
||||||
|
jnz .disk_full
|
||||||
|
mov word [edi-2], 0xFFF
|
||||||
|
mov esi, edi
|
||||||
|
mov edx, ecx
|
||||||
|
sub edi, 0x282000
|
||||||
|
shr edi, 1
|
||||||
|
dec edi ; now edi=new cluster
|
||||||
|
test eax, eax
|
||||||
|
jz .first_cluster
|
||||||
|
mov [0x282000+eax*2], di
|
||||||
|
jmp @f
|
||||||
|
.first_cluster:
|
||||||
|
pop eax ; eax->direntry
|
||||||
|
push eax
|
||||||
|
mov [eax+26], di
|
||||||
|
@@:
|
||||||
|
mov eax, edi ; eax=new cluster
|
||||||
|
pop edi ; edi->direntry
|
||||||
|
pop ecx ; ecx=required size
|
||||||
|
add dword [edi+28], 0x200
|
||||||
|
jmp .extend_loop
|
||||||
|
.extend_done:
|
||||||
|
mov [edi+28], ecx
|
||||||
|
pop esi edx
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
.disk_full:
|
||||||
|
pop edi ecx
|
||||||
|
pop esi edx
|
||||||
|
stc
|
||||||
|
push ERROR_DISK_FULL
|
||||||
|
pop eax
|
||||||
|
ret
|
||||||
|
|
||||||
fs_FloppyGetFileInfo:
|
fs_FloppyGetFileInfo:
|
||||||
call read_flp_fat
|
call read_flp_fat
|
||||||
cmp [FDC_Status], 0
|
cmp [FDC_Status], 0
|
||||||
@@ -1951,16 +2254,9 @@ fs_FloppySetFileInfo:
|
|||||||
push eax
|
push eax
|
||||||
call bdfe_to_fat_entry
|
call bdfe_to_fat_entry
|
||||||
pop eax
|
pop eax
|
||||||
test eax, eax
|
|
||||||
jz .root
|
|
||||||
add eax, 31
|
|
||||||
pusha
|
pusha
|
||||||
call save_chs_sector
|
call save_chs_sector
|
||||||
popa
|
popa
|
||||||
jmp .cmn
|
|
||||||
.root:
|
|
||||||
call save_flp_root
|
|
||||||
.cmn:
|
|
||||||
pop edi
|
pop edi
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
cmp [FDC_Status], 0
|
cmp [FDC_Status], 0
|
||||||
|
@@ -2,11 +2,12 @@
|
|||||||
;; ;;
|
;; ;;
|
||||||
;; FAT32.INC ;;
|
;; FAT32.INC ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; FAT16/32 functions for MenuetOS ;;
|
;; FAT16/32 functions for KolibriOS ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Copyright 2002 Paolo Minazzi, paolo.minazzi@inwind.it ;;
|
;; Copyright 2002 Paolo Minazzi, paolo.minazzi@inwind.it ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; See file COPYING for details ;;
|
;; See file COPYING for details ;;
|
||||||
|
;; 17.08.2006 LFN write/append to file - diamond ;;
|
||||||
;; 23.06.2006 LFN start application - diamond ;;
|
;; 23.06.2006 LFN start application - diamond ;;
|
||||||
;; 15.06.2006 LFN get/set file/folder info - diamond ;;
|
;; 15.06.2006 LFN get/set file/folder info - diamond ;;
|
||||||
;; 27.05.2006 LFN create/rewrite file - diamond ;;
|
;; 27.05.2006 LFN create/rewrite file - diamond ;;
|
||||||
@@ -104,7 +105,6 @@ uglobal
|
|||||||
startpath: times 255 db 0
|
startpath: times 255 db 0
|
||||||
|
|
||||||
fat16_root db 0 ; flag for fat16 rootdir
|
fat16_root db 0 ; flag for fat16 rootdir
|
||||||
f_del db 0 ; 1=overwrite fat entry
|
|
||||||
fat_change db 0 ; 1=fat has changed
|
fat_change db 0 ; 1=fat has changed
|
||||||
|
|
||||||
endg
|
endg
|
||||||
@@ -225,27 +225,12 @@ set_FAT:
|
|||||||
cmp [fat_type],16
|
cmp [fat_type],16
|
||||||
jne sfc_test32
|
jne sfc_test32
|
||||||
|
|
||||||
cmp [f_del],1 ; overwrite previous value?
|
|
||||||
je sfc_set16 ; yes
|
|
||||||
cmp word [ebx+esi],0 ; is cluster free?
|
|
||||||
je sfc_set16 ; yes
|
|
||||||
mov dword [8*0x100000],0xffffff
|
|
||||||
mov edx,[ebx+esi] ; get old value
|
|
||||||
jmp sfc_nonzero
|
|
||||||
|
|
||||||
sfc_set16:
|
sfc_set16:
|
||||||
xchg [ebx+esi],dx ; save new value and get old value
|
xchg [ebx+esi],dx ; save new value and get old value
|
||||||
jmp sfc_write
|
jmp sfc_write
|
||||||
|
|
||||||
sfc_test32:
|
sfc_test32:
|
||||||
mov eax,[fatMASK]
|
mov eax,[fatMASK]
|
||||||
cmp [f_del],1 ; overwrite previous value?
|
|
||||||
je sfc_set32 ; yes
|
|
||||||
test eax,[ebx+esi] ; is cluster free?
|
|
||||||
je sfc_set32 ; yes
|
|
||||||
mov dword [8*0x100000],0xffffff
|
|
||||||
mov edx,[ebx+esi] ; get old value
|
|
||||||
jmp sfc_nonzero
|
|
||||||
|
|
||||||
sfc_set32:
|
sfc_set32:
|
||||||
and edx,eax
|
and edx,eax
|
||||||
@@ -554,13 +539,10 @@ analyze_directory_to_write:
|
|||||||
push eax ; save new cluster
|
push eax ; save new cluster
|
||||||
mov edx,eax
|
mov edx,eax
|
||||||
mov eax,[cluster_tmp] ; change last cluster to point new cluster
|
mov eax,[cluster_tmp] ; change last cluster to point new cluster
|
||||||
mov [f_del],1
|
|
||||||
call set_FAT
|
call set_FAT
|
||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
jne adw_not_found_1
|
jne adw_not_found_1
|
||||||
|
|
||||||
mov [f_del],0
|
|
||||||
|
|
||||||
mov ecx,-1 ; remove 1 cluster from free disk space
|
mov ecx,-1 ; remove 1 cluster from free disk space
|
||||||
call add_disk_free_space
|
call add_disk_free_space
|
||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
@@ -883,13 +865,10 @@ makedir:
|
|||||||
jne make_dir_error_1
|
jne make_dir_error_1
|
||||||
mov eax,[cluster] ; directory cluster
|
mov eax,[cluster] ; directory cluster
|
||||||
xor edx,edx ; free
|
xor edx,edx ; free
|
||||||
mov [f_del],1
|
|
||||||
call set_FAT
|
call set_FAT
|
||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
jne make_dir_error_1
|
jne make_dir_error_1
|
||||||
|
|
||||||
mov [f_del],0
|
|
||||||
|
|
||||||
popad
|
popad
|
||||||
call update_disk ; write all of cache and fat to hd
|
call update_disk ; write all of cache and fat to hd
|
||||||
make_dir_error_2:
|
make_dir_error_2:
|
||||||
@@ -1238,12 +1217,10 @@ file_append:
|
|||||||
|
|
||||||
mov edx,eax
|
mov edx,eax
|
||||||
mov eax,[cluster]
|
mov eax,[cluster]
|
||||||
mov [f_del],1
|
|
||||||
call set_FAT ; update previous cluster
|
call set_FAT ; update previous cluster
|
||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
jne append_access_1
|
jne append_access_1
|
||||||
|
|
||||||
mov [f_del],0
|
|
||||||
pop eax
|
pop eax
|
||||||
jmp append_remove_free
|
jmp append_remove_free
|
||||||
|
|
||||||
@@ -1362,12 +1339,10 @@ file_append:
|
|||||||
|
|
||||||
truncate_pos_found:
|
truncate_pos_found:
|
||||||
mov edx,[fatEND] ; new end for cluster chain
|
mov edx,[fatEND] ; new end for cluster chain
|
||||||
mov [f_del],1
|
|
||||||
call set_FAT
|
call set_FAT
|
||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
jne append_access
|
jne append_access
|
||||||
|
|
||||||
mov [f_del],0
|
|
||||||
mov eax,edx ; clear rest of chain
|
mov eax,edx ; clear rest of chain
|
||||||
|
|
||||||
truncate_clear_chain:
|
truncate_clear_chain:
|
||||||
@@ -1875,7 +1850,6 @@ clear_cluster_chain:
|
|||||||
;-----------------------------------------------------
|
;-----------------------------------------------------
|
||||||
push eax ecx edx
|
push eax ecx edx
|
||||||
xor ecx,ecx ; cluster count
|
xor ecx,ecx ; cluster count
|
||||||
mov [f_del],1 ; delete on
|
|
||||||
|
|
||||||
clean_new_chain:
|
clean_new_chain:
|
||||||
cmp eax,[LAST_CLUSTER] ; end of file
|
cmp eax,[LAST_CLUSTER] ; end of file
|
||||||
@@ -1897,7 +1871,6 @@ clear_cluster_chain:
|
|||||||
delete_OK:
|
delete_OK:
|
||||||
call add_disk_free_space ; add clusters to free disk space
|
call add_disk_free_space ; add clusters to free disk space
|
||||||
access_denied_01:
|
access_denied_01:
|
||||||
mov [f_del],0
|
|
||||||
pop edx ecx eax
|
pop edx ecx eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -3288,7 +3261,6 @@ fat_notroot_extend_dir:
|
|||||||
mov eax, [esp+4]
|
mov eax, [esp+4]
|
||||||
mov eax, [eax]
|
mov eax, [eax]
|
||||||
push edx
|
push edx
|
||||||
mov [f_del], 1
|
|
||||||
call set_FAT
|
call set_FAT
|
||||||
pop edx
|
pop edx
|
||||||
cmp [hd_error], 0
|
cmp [hd_error], 0
|
||||||
@@ -3450,7 +3422,6 @@ fs_HdRewrite:
|
|||||||
mov word [edi+26], cx
|
mov word [edi+26], cx
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz .done1
|
jz .done1
|
||||||
mov [f_del], 1
|
|
||||||
@@:
|
@@:
|
||||||
cmp eax, [fatRESERVED]
|
cmp eax, [fatRESERVED]
|
||||||
jae .done1
|
jae .done1
|
||||||
@@ -3736,7 +3707,6 @@ fs_HdRewrite:
|
|||||||
mov ecx, eax
|
mov ecx, eax
|
||||||
call get_free_FAT
|
call get_free_FAT
|
||||||
jc .diskfull
|
jc .diskfull
|
||||||
mov [f_del], 1
|
|
||||||
push edx
|
push edx
|
||||||
mov edx, [fatEND]
|
mov edx, [fatEND]
|
||||||
call set_FAT
|
call set_FAT
|
||||||
@@ -3783,6 +3753,348 @@ fs_HdRewrite:
|
|||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
;----------------------------------------------------------------
|
||||||
|
;
|
||||||
|
; fs_HdWrite - LFN variant for writing to floppy
|
||||||
|
;
|
||||||
|
; esi points to filename
|
||||||
|
; ebx pointer to 64-bit number = first wanted byte, 0+
|
||||||
|
; may be ebx=0 - start from first byte
|
||||||
|
; ecx number of bytes to write, 0+
|
||||||
|
; edx mem location to data
|
||||||
|
;
|
||||||
|
; ret ebx = bytes written (maybe 0)
|
||||||
|
; eax = 0 ok write or other = errormsg
|
||||||
|
;
|
||||||
|
;--------------------------------------------------------------
|
||||||
|
fs_HdWrite.access_denied:
|
||||||
|
push ERROR_ACCESS_DENIED
|
||||||
|
fs_HdWrite.ret0:
|
||||||
|
pop eax
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
|
||||||
|
fs_HdWrite.ret11:
|
||||||
|
push 11
|
||||||
|
jmp fs_HdWrite.ret0
|
||||||
|
|
||||||
|
fs_HdWrite:
|
||||||
|
cmp [fat_type], 0
|
||||||
|
jnz @f
|
||||||
|
push ERROR_UNKNOWN_FS
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
cmp byte [esi], 0
|
||||||
|
jz .access_denied
|
||||||
|
pushad
|
||||||
|
call hd_find_lfn
|
||||||
|
pushfd
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
popfd
|
||||||
|
popad
|
||||||
|
push 11
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
popfd
|
||||||
|
jnc .found
|
||||||
|
popad
|
||||||
|
push ERROR_FILE_NOT_FOUND
|
||||||
|
jmp .ret0
|
||||||
|
.found:
|
||||||
|
; FAT does not support files larger than 4GB
|
||||||
|
test ebx, ebx
|
||||||
|
jz .l1
|
||||||
|
cmp dword [ebx+4], 0
|
||||||
|
jz @f
|
||||||
|
.eof:
|
||||||
|
popad
|
||||||
|
push ERROR_END_OF_FILE
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
mov ebx, [ebx]
|
||||||
|
.l1:
|
||||||
|
; now edi points to direntry, ebx=start byte to write,
|
||||||
|
; ecx=number of bytes to write, edx=data pointer
|
||||||
|
|
||||||
|
; extend file if needed
|
||||||
|
add ecx, ebx
|
||||||
|
jc .eof ; FAT does not support files larger than 4GB
|
||||||
|
push eax ; save directory sector
|
||||||
|
push 0 ; return value=0
|
||||||
|
|
||||||
|
call get_time_for_file
|
||||||
|
mov [edi+22], ax ; last write time
|
||||||
|
call get_date_for_file
|
||||||
|
mov [edi+24], ax ; last write date
|
||||||
|
mov [edi+18], ax ; last access date
|
||||||
|
|
||||||
|
push dword [edi+28] ; save current file size
|
||||||
|
cmp ecx, [edi+28]
|
||||||
|
jbe .length_ok
|
||||||
|
cmp ecx, ebx
|
||||||
|
jz .length_ok
|
||||||
|
call hd_extend_file
|
||||||
|
jnc .length_ok
|
||||||
|
mov [esp+4], eax
|
||||||
|
; hd_extend_file can return three error codes: FAT table error, device error or disk full.
|
||||||
|
; First two cases are fatal errors, in third case we may write some data
|
||||||
|
cmp al, ERROR_DISK_FULL
|
||||||
|
jz .disk_full
|
||||||
|
pop eax
|
||||||
|
pop eax
|
||||||
|
mov [esp+4+28], eax
|
||||||
|
pop eax
|
||||||
|
popad
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
.disk_full:
|
||||||
|
; correct number of bytes to write
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
cmp ecx, ebx
|
||||||
|
ja .length_ok
|
||||||
|
.ret:
|
||||||
|
call update_disk
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
mov byte [esp+4], 11
|
||||||
|
@@:
|
||||||
|
pop eax
|
||||||
|
pop eax
|
||||||
|
mov [esp+4+28], eax ; eax=return value
|
||||||
|
pop eax
|
||||||
|
sub edx, [esp+20]
|
||||||
|
mov [esp+16], edx ; ebx=number of written bytes
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
.length_ok:
|
||||||
|
mov esi, [edi+28]
|
||||||
|
mov eax, [edi+20-2]
|
||||||
|
mov ax, [edi+26]
|
||||||
|
mov edi, eax ; edi=current cluster
|
||||||
|
xor ebp, ebp ; ebp=current sector in cluster
|
||||||
|
; save directory
|
||||||
|
mov eax, [esp+8]
|
||||||
|
push ebx
|
||||||
|
mov ebx, buffer
|
||||||
|
call hd_write
|
||||||
|
pop ebx
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
.device_err:
|
||||||
|
mov byte [esp+4], 11
|
||||||
|
jmp .ret
|
||||||
|
@@:
|
||||||
|
|
||||||
|
; now ebx=start pos, ecx=end pos, both lie inside file
|
||||||
|
sub ecx, ebx
|
||||||
|
jz .ret
|
||||||
|
.write_loop:
|
||||||
|
; get length of data in current sector
|
||||||
|
push ecx
|
||||||
|
sub ebx, 0x200
|
||||||
|
jb .hasdata
|
||||||
|
neg ebx
|
||||||
|
xor ecx, ecx
|
||||||
|
jmp @f
|
||||||
|
.hasdata:
|
||||||
|
neg ebx
|
||||||
|
cmp ecx, ebx
|
||||||
|
jbe @f
|
||||||
|
mov ecx, ebx
|
||||||
|
@@:
|
||||||
|
; get current sector number
|
||||||
|
mov eax, edi
|
||||||
|
dec eax
|
||||||
|
dec eax
|
||||||
|
imul eax, [SECTORS_PER_CLUSTER]
|
||||||
|
add eax, [DATA_START]
|
||||||
|
add eax, ebp
|
||||||
|
; load sector if needed
|
||||||
|
cmp dword [esp+4], 0 ; we don't need to read uninitialized data
|
||||||
|
jz .noread
|
||||||
|
cmp ecx, 0x200 ; we don't need to read sector if it is fully rewritten
|
||||||
|
jz .noread
|
||||||
|
cmp ecx, esi ; (same for the last sector)
|
||||||
|
jz .noread
|
||||||
|
push ebx
|
||||||
|
mov ebx, buffer
|
||||||
|
call hd_read
|
||||||
|
pop ebx
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
.device_err2:
|
||||||
|
pop ecx
|
||||||
|
jmp .device_err
|
||||||
|
@@:
|
||||||
|
.noread:
|
||||||
|
; zero uninitialized data if file was extended (because hd_extend_file does not this)
|
||||||
|
push eax ecx edi
|
||||||
|
xor eax, eax
|
||||||
|
mov ecx, 0x200
|
||||||
|
sub ecx, [esp+4+12]
|
||||||
|
jbe @f
|
||||||
|
mov edi, buffer
|
||||||
|
add edi, [esp+4+12]
|
||||||
|
rep stosb
|
||||||
|
@@:
|
||||||
|
; zero uninitialized data in the last sector
|
||||||
|
mov ecx, 0x200
|
||||||
|
sub ecx, esi
|
||||||
|
jbe @f
|
||||||
|
mov edi, buffer
|
||||||
|
add edi, esi
|
||||||
|
rep stosb
|
||||||
|
@@:
|
||||||
|
pop edi ecx eax
|
||||||
|
; copy new data
|
||||||
|
push eax
|
||||||
|
mov eax, edx
|
||||||
|
neg ebx
|
||||||
|
jecxz @f
|
||||||
|
add ebx, buffer+0x200
|
||||||
|
call memmove
|
||||||
|
xor ebx, ebx
|
||||||
|
@@:
|
||||||
|
pop eax
|
||||||
|
; save sector
|
||||||
|
push ebx
|
||||||
|
mov ebx, buffer
|
||||||
|
call hd_write
|
||||||
|
pop ebx
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jnz .device_err2
|
||||||
|
add edx, ecx
|
||||||
|
sub [esp], ecx
|
||||||
|
pop ecx
|
||||||
|
jz .ret
|
||||||
|
; next sector
|
||||||
|
inc ebp
|
||||||
|
cmp ebp, [SECTORS_PER_CLUSTER]
|
||||||
|
jb @f
|
||||||
|
xor ebp, ebp
|
||||||
|
mov eax, edi
|
||||||
|
call get_FAT
|
||||||
|
mov edi, eax
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jnz .device_err
|
||||||
|
@@:
|
||||||
|
sub esi, 0x200
|
||||||
|
jae @f
|
||||||
|
xor esi, esi
|
||||||
|
@@:
|
||||||
|
sub dword [esp], 0x200
|
||||||
|
jae @f
|
||||||
|
and dword [esp], 0
|
||||||
|
@@: jmp .write_loop
|
||||||
|
|
||||||
|
hd_extend_file.zero_size:
|
||||||
|
xor eax, eax
|
||||||
|
jmp hd_extend_file.start_extend
|
||||||
|
|
||||||
|
; extends file on hd to given size (new data area is undefined)
|
||||||
|
; in: edi->direntry, ecx=new size
|
||||||
|
; out: CF=0 => OK, eax destroyed
|
||||||
|
; CF=1 => error, eax=code (ERROR_FAT_TABLE or ERROR_DISK_FULL or 11)
|
||||||
|
hd_extend_file:
|
||||||
|
push ebp
|
||||||
|
mov ebp, [SECTORS_PER_CLUSTER]
|
||||||
|
imul ebp, [BYTES_PER_SECTOR]
|
||||||
|
push ecx
|
||||||
|
; find the last cluster of file
|
||||||
|
mov eax, [edi+20-2]
|
||||||
|
mov ax, [edi+26]
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
jecxz .zero_size
|
||||||
|
.last_loop:
|
||||||
|
sub ecx, ebp
|
||||||
|
jbe .last_found
|
||||||
|
call get_FAT
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
.device_err:
|
||||||
|
pop ecx
|
||||||
|
.device_err2:
|
||||||
|
pop ebp
|
||||||
|
push 11
|
||||||
|
.ret_err:
|
||||||
|
pop eax
|
||||||
|
stc
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
cmp eax, 2
|
||||||
|
jb .fat_err
|
||||||
|
cmp eax, [fatRESERVED]
|
||||||
|
jb .last_loop
|
||||||
|
.fat_err:
|
||||||
|
pop ecx ebp
|
||||||
|
push ERROR_FAT_TABLE
|
||||||
|
jmp .ret_err
|
||||||
|
.last_found:
|
||||||
|
push eax
|
||||||
|
call get_FAT
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
pop eax
|
||||||
|
jmp .device_err
|
||||||
|
@@:
|
||||||
|
cmp eax, [fatRESERVED]
|
||||||
|
pop eax
|
||||||
|
jb .fat_err
|
||||||
|
; set length to full number of clusters
|
||||||
|
sub [edi+28], ecx
|
||||||
|
.start_extend:
|
||||||
|
pop ecx
|
||||||
|
; now do extend
|
||||||
|
push edx
|
||||||
|
mov edx, 2 ; start scan from cluster 2
|
||||||
|
.extend_loop:
|
||||||
|
cmp [edi+28], ecx
|
||||||
|
jae .extend_done
|
||||||
|
; add new cluster
|
||||||
|
push eax
|
||||||
|
mov eax, edx
|
||||||
|
call get_free_FAT
|
||||||
|
jc .disk_full
|
||||||
|
mov edx, [fatEND]
|
||||||
|
call set_FAT
|
||||||
|
mov edx, eax
|
||||||
|
pop eax
|
||||||
|
test eax, eax
|
||||||
|
jz .first_cluster
|
||||||
|
push edx
|
||||||
|
call set_FAT
|
||||||
|
pop edx
|
||||||
|
jmp @f
|
||||||
|
.first_cluster:
|
||||||
|
ror edx, 16
|
||||||
|
mov [edi+20], dx
|
||||||
|
ror edx, 16
|
||||||
|
mov [edi+26], dx
|
||||||
|
@@:
|
||||||
|
mov eax, edx
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jnz .device_err3
|
||||||
|
add [edi+28], ebp
|
||||||
|
jmp .extend_loop
|
||||||
|
.extend_done:
|
||||||
|
mov [edi+28], ecx
|
||||||
|
pop edx ebp
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
.device_err3:
|
||||||
|
pop edx
|
||||||
|
jmp .device_err2
|
||||||
|
.disk_full:
|
||||||
|
pop eax edx ebp
|
||||||
|
push ERROR_DISK_FULL
|
||||||
|
pop eax
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
mov al, 11
|
||||||
|
@@: stc
|
||||||
|
ret
|
||||||
|
|
||||||
fs_HdGetFileInfo:
|
fs_HdGetFileInfo:
|
||||||
cmp [fat_type], 0
|
cmp [fat_type], 0
|
||||||
jnz @f
|
jnz @f
|
||||||
|
@@ -347,7 +347,7 @@ fs_RamdiskServices:
|
|||||||
dd fs_RamdiskRead
|
dd fs_RamdiskRead
|
||||||
dd fs_RamdiskReadFolder
|
dd fs_RamdiskReadFolder
|
||||||
dd fs_RamdiskRewrite
|
dd fs_RamdiskRewrite
|
||||||
dd fs_NotImplemented
|
dd fs_RamdiskWrite
|
||||||
dd fs_NotImplemented
|
dd fs_NotImplemented
|
||||||
dd fs_RamdiskGetFileInfo
|
dd fs_RamdiskGetFileInfo
|
||||||
dd fs_RamdiskSetFileInfo
|
dd fs_RamdiskSetFileInfo
|
||||||
@@ -376,7 +376,7 @@ fs_FloppyServices:
|
|||||||
dd fs_FloppyRead
|
dd fs_FloppyRead
|
||||||
dd fs_FloppyReadFolder
|
dd fs_FloppyReadFolder
|
||||||
dd fs_FloppyRewrite
|
dd fs_FloppyRewrite
|
||||||
dd fs_NotImplemented
|
dd fs_FloppyWrite
|
||||||
dd fs_NotImplemented
|
dd fs_NotImplemented
|
||||||
dd fs_FloppyGetFileInfo
|
dd fs_FloppyGetFileInfo
|
||||||
dd fs_FloppySetFileInfo
|
dd fs_FloppySetFileInfo
|
||||||
@@ -447,7 +447,7 @@ fs_HdServices:
|
|||||||
dd fs_HdRead
|
dd fs_HdRead
|
||||||
dd fs_HdReadFolder
|
dd fs_HdReadFolder
|
||||||
dd fs_HdRewrite
|
dd fs_HdRewrite
|
||||||
dd fs_NotImplemented
|
dd fs_HdWrite
|
||||||
dd fs_NotImplemented
|
dd fs_NotImplemented
|
||||||
dd fs_HdGetFileInfo
|
dd fs_HdGetFileInfo
|
||||||
dd fs_HdSetFileInfo
|
dd fs_HdSetFileInfo
|
||||||
|
@@ -1788,6 +1788,7 @@ fs_RamdiskRewrite:
|
|||||||
sub ebx, edx
|
sub ebx, edx
|
||||||
mov [edi+28], ebx
|
mov [edi+28], ebx
|
||||||
add esp, 20
|
add esp, 20
|
||||||
|
mov [esp+16], ebx
|
||||||
popad
|
popad
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
@@ -1797,6 +1798,7 @@ fs_RamdiskRewrite:
|
|||||||
sub ebx, edx
|
sub ebx, edx
|
||||||
mov [edi+28], ebx
|
mov [edi+28], ebx
|
||||||
add esp, 20
|
add esp, 20
|
||||||
|
mov [esp+16], ebx
|
||||||
popad
|
popad
|
||||||
push ERROR_DISK_FULL
|
push ERROR_DISK_FULL
|
||||||
pop eax
|
pop eax
|
||||||
@@ -1820,6 +1822,230 @@ fs_RamdiskRewrite:
|
|||||||
loop .read_symbols
|
loop .read_symbols
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
;----------------------------------------------------------------
|
||||||
|
;
|
||||||
|
; fs_RamdiskWrite - LFN variant for writing to sys floppy
|
||||||
|
;
|
||||||
|
; esi points to filename
|
||||||
|
; ebx pointer to 64-bit number = first wanted byte, 0+
|
||||||
|
; may be ebx=0 - start from first byte
|
||||||
|
; ecx number of bytes to write, 0+
|
||||||
|
; edx mem location to data
|
||||||
|
;
|
||||||
|
; ret ebx = bytes written (maybe 0)
|
||||||
|
; eax = 0 ok write or other = errormsg
|
||||||
|
;
|
||||||
|
;--------------------------------------------------------------
|
||||||
|
@@:
|
||||||
|
push ERROR_ACCESS_DENIED
|
||||||
|
fs_RamdiskWrite.ret0:
|
||||||
|
pop eax
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
|
||||||
|
fs_RamdiskWrite:
|
||||||
|
cmp byte [esi], 0
|
||||||
|
jz @b
|
||||||
|
pushad
|
||||||
|
call rd_find_lfn
|
||||||
|
jnc .found
|
||||||
|
popad
|
||||||
|
push ERROR_FILE_NOT_FOUND
|
||||||
|
jmp .ret0
|
||||||
|
.found:
|
||||||
|
; must not be directory
|
||||||
|
test byte [edi+11], 10h
|
||||||
|
jz @f
|
||||||
|
popad
|
||||||
|
push ERROR_ACCESS_DENIED
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
; FAT does not support files larger than 4GB
|
||||||
|
test ebx, ebx
|
||||||
|
jz .l1
|
||||||
|
cmp dword [ebx+4], 0
|
||||||
|
jz @f
|
||||||
|
.eof:
|
||||||
|
popad
|
||||||
|
push ERROR_END_OF_FILE
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
mov ebx, [ebx]
|
||||||
|
.l1:
|
||||||
|
; now edi points to direntry, ebx=start byte to write,
|
||||||
|
; ecx=number of bytes to write, edx=data pointer
|
||||||
|
call get_time_for_file
|
||||||
|
mov [edi+22], ax ; last write time
|
||||||
|
call get_date_for_file
|
||||||
|
mov [edi+24], ax ; last write date
|
||||||
|
mov [edi+18], ax ; last access date
|
||||||
|
|
||||||
|
; extend file if needed
|
||||||
|
add ecx, ebx
|
||||||
|
jc .eof ; FAT does not support files larger than 4GB
|
||||||
|
push 0 ; return value=0
|
||||||
|
cmp ecx, [edi+28]
|
||||||
|
jbe .length_ok
|
||||||
|
cmp ecx, ebx
|
||||||
|
jz .length_ok
|
||||||
|
call ramdisk_extend_file
|
||||||
|
jnc .length_ok
|
||||||
|
; ramdisk_extend_file can return two error codes: FAT table error or disk full.
|
||||||
|
; First case is fatal error, in second case we may write some data
|
||||||
|
mov [esp], eax
|
||||||
|
cmp al, ERROR_DISK_FULL
|
||||||
|
jz .disk_full
|
||||||
|
pop eax
|
||||||
|
mov [esp+28], eax
|
||||||
|
popad
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
.disk_full:
|
||||||
|
; correct number of bytes to write
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
cmp ecx, ebx
|
||||||
|
ja .length_ok
|
||||||
|
.ret:
|
||||||
|
pop eax
|
||||||
|
mov [esp+28], eax ; eax=return value
|
||||||
|
sub edx, [esp+20]
|
||||||
|
mov [esp+16], edx ; ebx=number of written bytes
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
.length_ok:
|
||||||
|
; now ebx=start pos, ecx=end pos, both lie inside file
|
||||||
|
sub ecx, ebx
|
||||||
|
jz .ret
|
||||||
|
movzx edi, word [edi+26] ; starting cluster
|
||||||
|
.write_loop:
|
||||||
|
sub ebx, 0x200
|
||||||
|
jae .next_cluster
|
||||||
|
push ecx
|
||||||
|
neg ebx
|
||||||
|
cmp ecx, ebx
|
||||||
|
jbe @f
|
||||||
|
mov ecx, ebx
|
||||||
|
@@:
|
||||||
|
mov eax, edi
|
||||||
|
shl eax, 9
|
||||||
|
add eax, 0x100000+31*512+0x200
|
||||||
|
sub eax, ebx
|
||||||
|
mov ebx, eax
|
||||||
|
mov eax, edx
|
||||||
|
call memmove
|
||||||
|
xor ebx, ebx
|
||||||
|
add edx, ecx
|
||||||
|
sub [esp], ecx
|
||||||
|
pop ecx
|
||||||
|
jz .ret
|
||||||
|
.next_cluster:
|
||||||
|
movzx edi, word [edi*2+0x280000]
|
||||||
|
jmp .write_loop
|
||||||
|
|
||||||
|
ramdisk_extend_file.zero_size:
|
||||||
|
xor eax, eax
|
||||||
|
jmp ramdisk_extend_file.start_extend
|
||||||
|
|
||||||
|
; extends file on ramdisk to given size, new data area is filled by 0
|
||||||
|
; in: edi->direntry, ecx=new size
|
||||||
|
; out: CF=0 => OK, eax destroyed
|
||||||
|
; CF=1 => error, eax=code (ERROR_FAT_TABLE or ERROR_DISK_FULL)
|
||||||
|
ramdisk_extend_file:
|
||||||
|
push ecx
|
||||||
|
; find the last cluster of file
|
||||||
|
movzx eax, word [edi+26] ; first cluster
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
jecxz .zero_size
|
||||||
|
@@:
|
||||||
|
sub ecx, 0x200
|
||||||
|
jbe @f
|
||||||
|
mov eax, [eax*2+0x280000]
|
||||||
|
and eax, 0xFFF
|
||||||
|
jz .fat_err
|
||||||
|
cmp eax, 0xFF8
|
||||||
|
jb @b
|
||||||
|
.fat_err:
|
||||||
|
pop ecx
|
||||||
|
push ERROR_FAT_TABLE
|
||||||
|
pop eax
|
||||||
|
stc
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
push eax
|
||||||
|
mov eax, [eax*2+0x280000]
|
||||||
|
and eax, 0xFFF
|
||||||
|
cmp eax, 0xFF8
|
||||||
|
pop eax
|
||||||
|
jb .fat_err
|
||||||
|
; set length to full number of sectors and make sure that last sector is zero-padded
|
||||||
|
sub [edi+28], ecx
|
||||||
|
push eax edi
|
||||||
|
mov edi, eax
|
||||||
|
shl edi, 9
|
||||||
|
lea edi, [edi+0x100000+31*512+0x200+ecx]
|
||||||
|
neg ecx
|
||||||
|
xor eax, eax
|
||||||
|
rep stosb
|
||||||
|
pop edi eax
|
||||||
|
.start_extend:
|
||||||
|
pop ecx
|
||||||
|
; now do extend
|
||||||
|
push edx esi
|
||||||
|
mov esi, 0x280000+2*2 ; start scan from cluster 2
|
||||||
|
mov edx, 2847 ; number of clusters to scan
|
||||||
|
.extend_loop:
|
||||||
|
cmp [edi+28], ecx
|
||||||
|
jae .extend_done
|
||||||
|
; add new sector
|
||||||
|
push ecx
|
||||||
|
mov ecx, edx
|
||||||
|
push edi
|
||||||
|
mov edi, esi
|
||||||
|
jecxz .disk_full
|
||||||
|
push eax
|
||||||
|
xor eax, eax
|
||||||
|
repnz scasw
|
||||||
|
pop eax
|
||||||
|
jnz .disk_full
|
||||||
|
mov word [edi-2], 0xFFF
|
||||||
|
mov esi, edi
|
||||||
|
mov edx, ecx
|
||||||
|
sub edi, 0x280000
|
||||||
|
shr edi, 1
|
||||||
|
dec edi ; now edi=new cluster
|
||||||
|
test eax, eax
|
||||||
|
jz .first_cluster
|
||||||
|
mov [0x280000+eax*2], di
|
||||||
|
jmp @f
|
||||||
|
.first_cluster:
|
||||||
|
pop eax ; eax->direntry
|
||||||
|
push eax
|
||||||
|
mov [eax+26], di
|
||||||
|
@@:
|
||||||
|
push edi
|
||||||
|
shl edi, 9
|
||||||
|
add edi, 0x100000+31*512
|
||||||
|
xor eax, eax
|
||||||
|
mov ecx, 512/4
|
||||||
|
rep stosd
|
||||||
|
pop eax ; eax=new cluster
|
||||||
|
pop edi ; edi->direntry
|
||||||
|
pop ecx ; ecx=required size
|
||||||
|
add dword [edi+28], 0x200
|
||||||
|
jmp .extend_loop
|
||||||
|
.extend_done:
|
||||||
|
mov [edi+28], ecx
|
||||||
|
pop esi edx
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
.disk_full:
|
||||||
|
pop edi ecx
|
||||||
|
pop esi edx
|
||||||
|
stc
|
||||||
|
push ERROR_DISK_FULL
|
||||||
|
pop eax
|
||||||
|
ret
|
||||||
|
|
||||||
fs_RamdiskGetFileInfo:
|
fs_RamdiskGetFileInfo:
|
||||||
cmp byte [esi], 0
|
cmp byte [esi], 0
|
||||||
jnz @f
|
jnz @f
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,7 @@ All registers except explicitly declared in the returned value,
|
|||||||
============== Function 0 - define and draw the window. ==============
|
============== Function 0 - define and draw the window. ==============
|
||||||
======================================================================
|
======================================================================
|
||||||
Defines an application window. Draws a frame of the window, header and
|
Defines an application window. Draws a frame of the window, header and
|
||||||
working area. For windows with skin defines standard buttons for close
|
working area. For skinned windows defines standard buttons for close
|
||||||
and minimize.
|
and minimize.
|
||||||
Parameters:
|
Parameters:
|
||||||
* eax = 0 - function number
|
* eax = 0 - function number
|
||||||
@@ -18,10 +18,10 @@ Parameters:
|
|||||||
* ecx = [coordinate on axis y]*65536 + [size on axis y]
|
* ecx = [coordinate on axis y]*65536 + [size on axis y]
|
||||||
* edx = 0xXYRRGGBB, where:
|
* edx = 0xXYRRGGBB, where:
|
||||||
* Y = style of the window:
|
* Y = style of the window:
|
||||||
* Y=0 - type I - window of the fixed size
|
* Y=0 - type I - fixed-size window
|
||||||
* Y=1 - only define window area, draw nothing
|
* Y=1 - only define window area, draw nothing
|
||||||
* Y=2 - type II - window of the variable size
|
* Y=2 - type II - variable-size window
|
||||||
* Y=3 - window with skin
|
* Y=3 - skinned window
|
||||||
* other possible values (from 4 up to 15) are reserved,
|
* other possible values (from 4 up to 15) are reserved,
|
||||||
function call with such Y is ignored
|
function call with such Y is ignored
|
||||||
* RR, GG, BB = accordingly red, green, blue components of a color
|
* RR, GG, BB = accordingly red, green, blue components of a color
|
||||||
@@ -61,11 +61,11 @@ Remarks:
|
|||||||
* The window must fit on the screen. If the transferred
|
* The window must fit on the screen. If the transferred
|
||||||
coordinates and sizes do not satisfy to this condition,
|
coordinates and sizes do not satisfy to this condition,
|
||||||
appropriate coordinate (or, probably, both) is considered as zero,
|
appropriate coordinate (or, probably, both) is considered as zero,
|
||||||
and if also it does not help, the appropriate size
|
and if it does not help too, the appropriate size
|
||||||
(or, probably, both) is installed in a size of the screen.
|
(or, probably, both) is installed in a size of the screen.
|
||||||
|
|
||||||
Further we shall designate xpos,ypos,xsize,ysize - values
|
Further let us designate xpos,ypos,xsize,ysize - values passed
|
||||||
transmitted in ebx,ecx. The coordinates are resulted concerning
|
in ebx,ecx. The coordinates are resulted concerning
|
||||||
the left upper corner of the window, which, thus, is set as (0,0),
|
the left upper corner of the window, which, thus, is set as (0,0),
|
||||||
coordinates of the right lower corner essence (xsize,ysize).
|
coordinates of the right lower corner essence (xsize,ysize).
|
||||||
* The sizes of the window are understood in sence of coordinates
|
* The sizes of the window are understood in sence of coordinates
|
||||||
@@ -289,7 +289,7 @@ Returned value:
|
|||||||
* function does not return value
|
* function does not return value
|
||||||
Remarks:
|
Remarks:
|
||||||
* Sizes of the button must be more than 0 and less than 0x8000.
|
* Sizes of the button must be more than 0 and less than 0x8000.
|
||||||
* For windows with skin definition of the window
|
* For skinned windows definition of the window
|
||||||
(call of 0th function) creates two standard buttons -
|
(call of 0th function) creates two standard buttons -
|
||||||
for close of the window with identifier 1 and
|
for close of the window with identifier 1 and
|
||||||
for minimize of the window with identifier 0xffff.
|
for minimize of the window with identifier 0xffff.
|
||||||
@@ -926,53 +926,66 @@ Remarks:
|
|||||||
process/thread by given slot.
|
process/thread by given slot.
|
||||||
|
|
||||||
======================================================================
|
======================================================================
|
||||||
====================== Function 18, subfunction 19 =====================
|
======== Function 18, subfunction 19 - get/set mouse features. =======
|
||||||
======================= Get/set mouse features. ======================
|
|
||||||
======================================================================
|
======================================================================
|
||||||
|
|
||||||
|
---------------- Subsubfunction 0 - get mouse speed. -----------------
|
||||||
Parameters:
|
Parameters:
|
||||||
* eax = 18 - function number
|
* eax = 18 - function number
|
||||||
* ebx = 19 - subfunction number
|
* ebx = 19 - subfunction number
|
||||||
* ecx = subsubfunction number
|
* ecx = 0 - subsubfunction number
|
||||||
|
Returned value:
|
||||||
|
* eax = current mouse speed
|
||||||
|
|
||||||
ecx = 0 - get mouse speed
|
---------------- Subsubfunction 1 - set mouse speed. -----------------
|
||||||
Returned value:
|
Parameters:
|
||||||
* eax = current mouse speed
|
* eax = 18 - function number
|
||||||
|
* ebx = 19 - subfunction number
|
||||||
|
* ecx = 1 - subsubfunction number
|
||||||
|
* edx = new value for speed
|
||||||
|
Returned value:
|
||||||
|
* function does not return value
|
||||||
|
|
||||||
ecx = 1 - set mouse speed
|
---------------- Subsubfunction 2 - get mouse delay. -----------------
|
||||||
edx = selected value of speed
|
Parameters:
|
||||||
Returned value:
|
* eax = 18 - function number
|
||||||
* function does not return value
|
* ebx = 19 - subfunction number
|
||||||
|
* ecx = 2 - subsubfunction number
|
||||||
|
Returned value:
|
||||||
|
* eax = current mouse delay
|
||||||
|
|
||||||
ecx = 2 - get mouse delay
|
---------------- Subsubfunction 3 - set mouse delay. -----------------
|
||||||
Returned value:
|
Parameters:
|
||||||
* eax = current mouse delay
|
* eax = 18 - function number
|
||||||
|
* ebx = 19 - subfunction number
|
||||||
ecx = 3 - set mouse delay
|
* ecx = 3 - subsubfunction number
|
||||||
edx = selected value of delay
|
* edx = new value for mouse delay
|
||||||
Returned value:
|
Returned value:
|
||||||
* function does not return value
|
* function does not return value
|
||||||
|
|
||||||
ecx = 4 - set mouse pointer position
|
|
||||||
edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
|
||||||
Returned value:
|
|
||||||
* function does not return value
|
|
||||||
|
|
||||||
|
----------- Subsubfunction 4 - set mouse pointer position. -----------
|
||||||
|
Parameters:
|
||||||
|
* eax = 18 - function number
|
||||||
|
* ebx = 19 - subfunction number
|
||||||
|
* ecx = 4 - subsubfunction number
|
||||||
|
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
||||||
|
Returned value:
|
||||||
|
* function does not return value
|
||||||
Remarks:
|
Remarks:
|
||||||
* Recommended speed of the mouse (in subfunction 1) from 1 up to 9.
|
* It is recommended to set speed of the mouse (in subsubfunction 1)
|
||||||
The installed value is not inspected by the code of a kernel, on this use
|
from 1 up to 9. The installed value is not inspected by the kernel
|
||||||
cautiously, at incorrect value the cursor can "freeze".
|
code, so set it carefully, at incorrect value the cursor
|
||||||
Speed of mouse can be regulated through the application SETUP.
|
can "freeze". Speed of the mouse can be regulated through the
|
||||||
* Recommended delay of the mouse (in subfunction 3) = 10. Lower value
|
application SETUP.
|
||||||
is not handled COM by mice. At the very large values the movement of
|
* Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
|
||||||
the mouse on 1 pixel is impossible and the cursor will jump
|
value is not handled by COM mice. At the very large values the
|
||||||
on the value of the installed speed (subfunction 1).
|
movement of the mouse on 1 pixel is impossible and the cursor will
|
||||||
Delay of mouse can be regulated through the application SETUP.
|
jump on the value of installed speed (subsubfunction 1). The
|
||||||
The installed value is not inspected by the code of a kernel.
|
installed value is not inspected by the kernel code.
|
||||||
* In subfunction 4 the installed value is not inspected by
|
* The subsubfunction 4 does not check the passed value. Before
|
||||||
the code of a kernel. Before usage it is necessary to find out current
|
its call find out current screen resolution (with function 14)
|
||||||
screen resolution and at installation of a position to watch,
|
and check that the value of position is inside the limits of the
|
||||||
that the value of a position should do not fall outside
|
screen.
|
||||||
the limits the screen.
|
|
||||||
|
|
||||||
======================================================================
|
======================================================================
|
||||||
============ Function 19 - start application from ramdisk. ===========
|
============ Function 19 - start application from ramdisk. ===========
|
||||||
@@ -2135,11 +2148,11 @@ Remarks:
|
|||||||
* Structure of the color table is described in the standard
|
* Structure of the color table is described in the standard
|
||||||
include file 'macros.inc' as 'system_colors'; for example,
|
include file 'macros.inc' as 'system_colors'; for example,
|
||||||
it is possible to write:
|
it is possible to write:
|
||||||
sc system_colors ; variable declaration
|
sc system_colors ; variable declaration
|
||||||
... ; somewhere one must call
|
... ; somewhere one must call
|
||||||
; this function with ecx=sc
|
; this function with ecx=sc
|
||||||
mov ecx, [sc.work_button_text] ; read text color on
|
mov ecx, [sc.work_button_text] ; read text color on
|
||||||
; buttin in working area
|
; buttin in working area
|
||||||
* A program itself desides to use or not to use color table.
|
* A program itself desides to use or not to use color table.
|
||||||
For usage program must simply at calls to drawing functions select
|
For usage program must simply at calls to drawing functions select
|
||||||
color taken from the table.
|
color taken from the table.
|
||||||
@@ -2995,6 +3008,7 @@ Returned value:
|
|||||||
* eax = 0 - success, otherwise file system error code
|
* eax = 0 - success, otherwise file system error code
|
||||||
* ebx destroyed
|
* ebx destroyed
|
||||||
Remarks:
|
Remarks:
|
||||||
|
* This function is obsolete, use subfunction 3 of function 70.
|
||||||
* Ramdisk and floppies do not support this function, it is only
|
* Ramdisk and floppies do not support this function, it is only
|
||||||
for hard disks.
|
for hard disks.
|
||||||
* File must already exist (otherwise function returns 5, not found).
|
* File must already exist (otherwise function returns 5, not found).
|
||||||
@@ -3289,11 +3303,11 @@ Remarks:
|
|||||||
The data of the graphics screen (the memory area which displays
|
The data of the graphics screen (the memory area which displays
|
||||||
screen contents) are accessible to a program directly, without
|
screen contents) are accessible to a program directly, without
|
||||||
any system calls, through the selector gs:
|
any system calls, through the selector gs:
|
||||||
mov eax, [gs:0]
|
mov eax, [gs:0]
|
||||||
places in eax the first dword of the buffer, which contains
|
places in eax the first dword of the buffer, which contains
|
||||||
information on color of the left upper point (and, possibly, colors
|
information on color of the left upper point (and, possibly, colors
|
||||||
of several following).
|
of several following).
|
||||||
mov [gs:0], eax
|
mov [gs:0], eax
|
||||||
by work in VESA modes with LFB sets color of the left upper point
|
by work in VESA modes with LFB sets color of the left upper point
|
||||||
(and, possibly, colors of several following).
|
(and, possibly, colors of several following).
|
||||||
To interpret the data of graphics screen program needs to know
|
To interpret the data of graphics screen program needs to know
|
||||||
@@ -3855,7 +3869,7 @@ Remarks:
|
|||||||
and at arrival of new message the system will wait.
|
and at arrival of new message the system will wait.
|
||||||
For synchronization frame all work with the buffer by operations
|
For synchronization frame all work with the buffer by operations
|
||||||
lock/unlock
|
lock/unlock
|
||||||
neg [bufsize]
|
neg [bufsize]
|
||||||
* Data in the buffer are considered as array of items with variable
|
* Data in the buffer are considered as array of items with variable
|
||||||
length - messages. Format of a message is explained in
|
length - messages. Format of a message is explained in
|
||||||
general description.
|
general description.
|
||||||
@@ -4085,6 +4099,7 @@ Available subfunctions:
|
|||||||
* subfunction 0 - read file
|
* subfunction 0 - read file
|
||||||
* subfunction 1 - read folder
|
* subfunction 1 - read folder
|
||||||
* subfunction 2 - create/rewrite file
|
* subfunction 2 - create/rewrite file
|
||||||
|
* subfunction 3 - write to existing file
|
||||||
* subfunction 5 - get attributes of file/folder
|
* subfunction 5 - get attributes of file/folder
|
||||||
* subfunction 6 - set attributes of file/folder
|
* subfunction 6 - set attributes of file/folder
|
||||||
* subfunction 7 - start application
|
* subfunction 7 - start application
|
||||||
@@ -4244,6 +4259,35 @@ Remarks:
|
|||||||
write as many as can and then return error code 8.
|
write as many as can and then return error code 8.
|
||||||
* The function is not supported for CD (returns error code 2).
|
* The function is not supported for CD (returns error code 2).
|
||||||
|
|
||||||
|
======================================================================
|
||||||
|
===================== Function 70, subfunction 3 =====================
|
||||||
|
=========== Write to existing file with long names support. ==========
|
||||||
|
======================================================================
|
||||||
|
Parameters:
|
||||||
|
* eax = 70 - function number
|
||||||
|
* ebx = pointer to the information structure
|
||||||
|
Format of the information structure:
|
||||||
|
* +0: dword: 3 = subfunction number
|
||||||
|
* +4: dword: file offset (in bytes)
|
||||||
|
* +8: dword: high dword of offset (must be 0 for FAT)
|
||||||
|
* +12 = +0xC: dword: number of bytes to write
|
||||||
|
* +16 = +0x10: dword: pointer to data
|
||||||
|
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
|
||||||
|
given in the general description
|
||||||
|
or
|
||||||
|
* +20 = +0x14: db 0
|
||||||
|
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
|
||||||
|
Returned value:
|
||||||
|
* eax = 0 - success, otherwise file system error code
|
||||||
|
* ebx = number of written bytes (possibly 0)
|
||||||
|
Remarks:
|
||||||
|
* The file must already exist, otherwise function returns eax=5.
|
||||||
|
* The only result of write 0 bytes is update in the file attributes
|
||||||
|
date/time of modification and access to the current date/time.
|
||||||
|
* If beginning and/or ending position is greater than file size
|
||||||
|
(except for the previous case), the file is expanded to needed
|
||||||
|
size with zero characters.
|
||||||
|
|
||||||
======================================================================
|
======================================================================
|
||||||
==== Function 70, subfunction 5 - get information on file/folder. ====
|
==== Function 70, subfunction 5 - get information on file/folder. ====
|
||||||
======================================================================
|
======================================================================
|
||||||
@@ -4421,4 +4465,3 @@ Application start functions can return also following errors:
|
|||||||
* 30 = 0x1E = not enough memory
|
* 30 = 0x1E = not enough memory
|
||||||
* 31 = 0x1F = file is not executable
|
* 31 = 0x1F = file is not executable
|
||||||
* 32 = 0x20 = too many processes
|
* 32 = 0x20 = too many processes
|
||||||
|
|
||||||
|
@@ -63,9 +63,9 @@ rdfs2_1:
|
|||||||
fdc_status_error_2:
|
fdc_status_error_2:
|
||||||
pop ecx ebx eax
|
pop ecx ebx eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
floppy_fileread:
|
floppy_fileread:
|
||||||
;----------------------------------------------------------------
|
;----------------------------------------------------------------
|
||||||
@@ -115,7 +115,7 @@ fr_do_1:
|
|||||||
ret
|
ret
|
||||||
fdc_status_error_1:
|
fdc_status_error_1:
|
||||||
mov [flp_status],0
|
mov [flp_status],0
|
||||||
mov eax,10
|
mov eax,10
|
||||||
mov ebx,-1
|
mov ebx,-1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ frfl8_1:
|
|||||||
sub [esp+24],dword 512
|
sub [esp+24],dword 512
|
||||||
jmp frnew_1
|
jmp frnew_1
|
||||||
|
|
||||||
read_chs_sector:
|
read_chs_sector:
|
||||||
call calculate_chs
|
call calculate_chs
|
||||||
call ReadSectWithRetr
|
call ReadSectWithRetr
|
||||||
ret
|
ret
|
||||||
@@ -273,7 +273,7 @@ read_flp_root:
|
|||||||
je unnecessary_root_read
|
je unnecessary_root_read
|
||||||
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Head],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Head],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov edi,0x8000
|
mov edi,0x8000
|
||||||
call SeekTrack
|
call SeekTrack
|
||||||
read_flp_root_1:
|
read_flp_root_1:
|
||||||
@@ -302,7 +302,7 @@ read_flp_fat:
|
|||||||
je unnecessary_flp_fat
|
je unnecessary_flp_fat
|
||||||
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov edi,0x8000
|
mov edi,0x8000
|
||||||
call SeekTrack
|
call SeekTrack
|
||||||
read_flp_fat_1:
|
read_flp_fat_1:
|
||||||
@@ -358,7 +358,7 @@ calculatefatchain_flp:
|
|||||||
mov dword [edi],ecx
|
mov dword [edi],ecx
|
||||||
add edi,4
|
add edi,4
|
||||||
mov dword [edi],edx
|
mov dword [edi],edx
|
||||||
add edi,4
|
add edi,4
|
||||||
add esi,12
|
add esi,12
|
||||||
|
|
||||||
cmp edi,0x282000+2856*2 ;2849 clusters
|
cmp edi,0x282000+2856*2 ;2849 clusters
|
||||||
@@ -366,12 +366,12 @@ calculatefatchain_flp:
|
|||||||
|
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
|
||||||
check_label:
|
check_label:
|
||||||
pushad
|
pushad
|
||||||
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Sector],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Sector],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
call SetUserInterrupts
|
call SetUserInterrupts
|
||||||
call FDDMotorON
|
call FDDMotorON
|
||||||
call RecalibrateFDD
|
call RecalibrateFDD
|
||||||
@@ -382,12 +382,12 @@ check_label:
|
|||||||
jne fdc_status_error
|
jne fdc_status_error
|
||||||
call ReadSectWithRetr
|
call ReadSectWithRetr
|
||||||
cmp [FDC_Status],0
|
cmp [FDC_Status],0
|
||||||
jne fdc_status_error
|
jne fdc_status_error
|
||||||
mov esi,flp_label
|
mov esi,flp_label
|
||||||
mov edi,0xD000+39
|
mov edi,0xD000+39
|
||||||
mov ecx,15
|
mov ecx,15
|
||||||
cld
|
cld
|
||||||
rep cmpsb
|
rep cmpsb
|
||||||
je same_label
|
je same_label
|
||||||
mov [root_read],0
|
mov [root_read],0
|
||||||
mov [flp_fat],0
|
mov [flp_fat],0
|
||||||
@@ -412,7 +412,7 @@ save_flp_root:
|
|||||||
je unnecessary_root_save
|
je unnecessary_root_save
|
||||||
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Head],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Head],1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov esi,0x8000
|
mov esi,0x8000
|
||||||
call SeekTrack
|
call SeekTrack
|
||||||
save_flp_root_1:
|
save_flp_root_1:
|
||||||
@@ -430,7 +430,7 @@ unnecessary_root_save:
|
|||||||
mov [fdc_irq_func],fdc_null
|
mov [fdc_irq_func],fdc_null
|
||||||
popa
|
popa
|
||||||
ret
|
ret
|
||||||
|
|
||||||
save_flp_fat:
|
save_flp_fat:
|
||||||
pusha
|
pusha
|
||||||
call check_label
|
call check_label
|
||||||
@@ -441,7 +441,7 @@ save_flp_fat:
|
|||||||
call restorefatchain_flp
|
call restorefatchain_flp
|
||||||
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Track],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Head],0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov [FDD_Sector],2 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov esi,0x8000
|
mov esi,0x8000
|
||||||
call SeekTrack
|
call SeekTrack
|
||||||
save_flp_fat_1:
|
save_flp_fat_1:
|
||||||
@@ -467,7 +467,7 @@ unnecessary_flp_fat_save:
|
|||||||
popa
|
popa
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
restorefatchain_flp: ; restore fat chain
|
restorefatchain_flp: ; restore fat chain
|
||||||
pushad
|
pushad
|
||||||
|
|
||||||
@@ -563,7 +563,7 @@ fifoundd_1:
|
|||||||
mov ebx,[path_pointer_flp]
|
mov ebx,[path_pointer_flp]
|
||||||
add ebx,36
|
add ebx,36
|
||||||
call get_cluster_of_a_path_flp
|
call get_cluster_of_a_path_flp
|
||||||
jc frnoreadd_1_1
|
jc frnoreadd_1_1
|
||||||
mov edi,ebx
|
mov edi,ebx
|
||||||
add edi,11
|
add edi,11
|
||||||
jmp fifoundd_2_1
|
jmp fifoundd_2_1
|
||||||
@@ -617,7 +617,7 @@ floppy_filesave:
|
|||||||
; edi pointer to path /fd/1/...... - for all files in nested directories
|
; edi pointer to path /fd/1/...... - for all files in nested directories
|
||||||
;
|
;
|
||||||
; output : eax = 0 - ok
|
; output : eax = 0 - ok
|
||||||
; 5 - file not found / directory not found
|
; 5 - file not found / directory not found
|
||||||
; 8 - disk full
|
; 8 - disk full
|
||||||
; 10 - access denied
|
; 10 - access denied
|
||||||
;-----------------------------------------------------------
|
;-----------------------------------------------------------
|
||||||
@@ -644,10 +644,10 @@ fsdel_1:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
fdc_status_error_6:
|
fdc_status_error_6:
|
||||||
popa
|
popa
|
||||||
add esp,32
|
add esp,32
|
||||||
jmp fdc_status_error_1
|
jmp fdc_status_error_1
|
||||||
|
|
||||||
rd_do_save_1:
|
rd_do_save_1:
|
||||||
push eax ebx ecx edx esi edi
|
push eax ebx ecx edx esi edi
|
||||||
call read_flp_fat
|
call read_flp_fat
|
||||||
@@ -749,7 +749,7 @@ fifoundds_4:
|
|||||||
mov ebx,1 ; first cluster
|
mov ebx,1 ; first cluster
|
||||||
cmp [save_root_flag],0
|
cmp [save_root_flag],0
|
||||||
jne frnewds_1
|
jne frnewds_1
|
||||||
call frnewds_2
|
call frnewds_2
|
||||||
pusha
|
pusha
|
||||||
call WriteSectWithRetr
|
call WriteSectWithRetr
|
||||||
popa
|
popa
|
||||||
@@ -811,7 +811,7 @@ frnoreadds_1:
|
|||||||
|
|
||||||
fdc_status_error_7_1:
|
fdc_status_error_7_1:
|
||||||
cmp [FDC_Status],0
|
cmp [FDC_Status],0
|
||||||
je fdc_status_error_8
|
je fdc_status_error_8
|
||||||
fdc_status_error_7:
|
fdc_status_error_7:
|
||||||
pop edi esi edx ecx ebx eax
|
pop edi esi edx ecx ebx eax
|
||||||
add esp,32
|
add esp,32
|
||||||
@@ -821,10 +821,10 @@ save_chs_sector:
|
|||||||
call calculate_chs
|
call calculate_chs
|
||||||
call WriteSectWithRetr
|
call WriteSectWithRetr
|
||||||
ret
|
ret
|
||||||
|
|
||||||
calculate_chs:
|
calculate_chs:
|
||||||
mov bl,[FDD_Track]
|
mov bl,[FDD_Track]
|
||||||
mov [old_track],bl
|
mov [old_track],bl
|
||||||
mov ebx,18
|
mov ebx,18
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
div ebx
|
div ebx
|
||||||
@@ -846,7 +846,7 @@ no_head_2:
|
|||||||
no_seek_track_1:
|
no_seek_track_1:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
get_cluster_of_a_path_flp:
|
get_cluster_of_a_path_flp:
|
||||||
;---------------------------------------------------------
|
;---------------------------------------------------------
|
||||||
; input : EBX = pointer to a path string
|
; input : EBX = pointer to a path string
|
||||||
@@ -892,7 +892,7 @@ directory_not_found_flp:
|
|||||||
pop edx
|
pop edx
|
||||||
stc ; errors occour
|
stc ; errors occour
|
||||||
ret
|
ret
|
||||||
|
|
||||||
analyze_directory_flp:
|
analyze_directory_flp:
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
; input : EAX = first cluster of the directory
|
; input : EAX = first cluster of the directory
|
||||||
@@ -908,8 +908,8 @@ analyze_directory_flp:
|
|||||||
push edx
|
push edx
|
||||||
push esi
|
push esi
|
||||||
push edi
|
push edi
|
||||||
|
|
||||||
|
|
||||||
adr56_flp:
|
adr56_flp:
|
||||||
mov [clust_tmp_flp],eax
|
mov [clust_tmp_flp],eax
|
||||||
add eax,31
|
add eax,31
|
||||||
@@ -921,7 +921,7 @@ adr56_flp:
|
|||||||
|
|
||||||
mov ecx,512/32
|
mov ecx,512/32
|
||||||
mov ebx,0xD000
|
mov ebx,0xD000
|
||||||
|
|
||||||
adr1_analyze_flp:
|
adr1_analyze_flp:
|
||||||
mov esi,edx ;[esp+16]
|
mov esi,edx ;[esp+16]
|
||||||
mov edi,ebx
|
mov edi,ebx
|
||||||
@@ -931,10 +931,10 @@ adr1_analyze_flp:
|
|||||||
rep cmpsb
|
rep cmpsb
|
||||||
pop ecx
|
pop ecx
|
||||||
je found_file_analyze_flp
|
je found_file_analyze_flp
|
||||||
|
|
||||||
add ebx,32
|
add ebx,32
|
||||||
loop adr1_analyze_flp
|
loop 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,0x282000
|
||||||
@@ -942,7 +942,7 @@ adr1_analyze_flp:
|
|||||||
and eax,4095
|
and eax,4095
|
||||||
cmp eax,0x0ff8
|
cmp eax,0x0ff8
|
||||||
jb adr56_flp
|
jb adr56_flp
|
||||||
not_found_file_analyze_flp:
|
not_found_file_analyze_flp:
|
||||||
pop edi
|
pop edi
|
||||||
pop esi
|
pop esi
|
||||||
pop edx
|
pop edx
|
||||||
@@ -950,7 +950,7 @@ not_found_file_analyze_flp:
|
|||||||
add esp,4
|
add esp,4
|
||||||
stc ;file not found
|
stc ;file not found
|
||||||
ret
|
ret
|
||||||
|
|
||||||
found_file_analyze_flp:
|
found_file_analyze_flp:
|
||||||
pop edi
|
pop edi
|
||||||
pop esi
|
pop esi
|
||||||
@@ -959,8 +959,8 @@ found_file_analyze_flp:
|
|||||||
add esp,4
|
add esp,4
|
||||||
clc ;file found
|
clc ;file found
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
analyze_directory_to_write_flp:
|
analyze_directory_to_write_flp:
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
; input : EAX = first cluster of the directory
|
; input : EAX = first cluster of the directory
|
||||||
@@ -970,33 +970,33 @@ analyze_directory_to_write_flp:
|
|||||||
; ECX,EDX,EDI,EDI not changed
|
; ECX,EDX,EDI,EDI not changed
|
||||||
; IF CARRY=1
|
; IF CARRY=1
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
|
|
||||||
push ecx
|
push ecx
|
||||||
push edx
|
push edx
|
||||||
push esi
|
push esi
|
||||||
|
|
||||||
adr561:
|
adr561:
|
||||||
mov [clust_tmp_flp],eax
|
mov [clust_tmp_flp],eax
|
||||||
add eax,31
|
add eax,31
|
||||||
pusha
|
pusha
|
||||||
call read_chs_sector
|
call read_chs_sector
|
||||||
popa
|
popa
|
||||||
cmp [FDC_Status],0
|
cmp [FDC_Status],0
|
||||||
jne error_found_file_analyze1
|
jne error_found_file_analyze1
|
||||||
|
|
||||||
mov ecx,512/32
|
mov ecx,512/32
|
||||||
mov ebx,0xD000
|
mov ebx,0xD000
|
||||||
|
|
||||||
adr1_analyze1:
|
adr1_analyze1:
|
||||||
cmp byte [ebx],0x00
|
cmp byte [ebx],0x00
|
||||||
je found_file_analyze1
|
je found_file_analyze1
|
||||||
cmp byte [ebx],0xe5
|
cmp byte [ebx],0xe5
|
||||||
je found_file_analyze1
|
je found_file_analyze1
|
||||||
|
|
||||||
avanti:
|
avanti:
|
||||||
add ebx,32
|
add ebx,32
|
||||||
loop adr1_analyze1
|
loop adr1_analyze1
|
||||||
|
|
||||||
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,0x282000
|
||||||
@@ -1004,13 +1004,13 @@ avanti:
|
|||||||
and eax,4095
|
and eax,4095
|
||||||
cmp eax,0x0ff8
|
cmp eax,0x0ff8
|
||||||
jb adr561
|
jb adr561
|
||||||
|
|
||||||
call get_free_FAT ;this block of code add a new cluster
|
call get_free_FAT ;this block of code add a new cluster
|
||||||
;for the directory because the directory
|
;for the directory because the directory
|
||||||
;is full
|
;is full
|
||||||
|
|
||||||
mov [edi],word 0x0fff
|
mov [edi],word 0x0fff
|
||||||
|
|
||||||
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,0x282000
|
||||||
@@ -1028,14 +1028,14 @@ avanti:
|
|||||||
mov eax,edi
|
mov eax,edi
|
||||||
add eax,31
|
add eax,31
|
||||||
pusha
|
pusha
|
||||||
call save_chs_sector
|
call save_chs_sector
|
||||||
popa
|
popa
|
||||||
cmp [FDC_Status],0
|
cmp [FDC_Status],0
|
||||||
jne error_found_file_analyze1
|
jne error_found_file_analyze1
|
||||||
mov ebx,0xD000
|
mov ebx,0xD000
|
||||||
|
|
||||||
found_file_analyze1:
|
found_file_analyze1:
|
||||||
|
|
||||||
pop esi
|
pop esi
|
||||||
pop edx
|
pop edx
|
||||||
pop ecx
|
pop ecx
|
||||||
@@ -1047,15 +1047,15 @@ error_found_file_analyze1:
|
|||||||
pop edx
|
pop edx
|
||||||
pop ecx
|
pop ecx
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
|
|
||||||
get_free_FAT_flp:
|
get_free_FAT_flp:
|
||||||
;------------------------------------------
|
;------------------------------------------
|
||||||
; input : EAX = # cluster for start the searching
|
; input : EAX = # cluster for start the searching
|
||||||
; output : EAX = # first cluster found free
|
; output : EAX = # first cluster found free
|
||||||
;-------------------------------------------
|
;-------------------------------------------
|
||||||
push ebx
|
push ebx
|
||||||
|
|
||||||
mov ebx,1
|
mov ebx,1
|
||||||
check_new_flp:
|
check_new_flp:
|
||||||
add ebx,1
|
add ebx,1
|
||||||
@@ -1265,6 +1265,11 @@ fd_find_lfn:
|
|||||||
ret
|
ret
|
||||||
.found:
|
.found:
|
||||||
mov eax, [esp+8]
|
mov eax, [esp+8]
|
||||||
|
add eax, 31
|
||||||
|
cmp dword [esp], flp_root_next
|
||||||
|
jnz @f
|
||||||
|
add eax, -31+19
|
||||||
|
@@:
|
||||||
add esp, 16 ; CF=0
|
add esp, 16 ; CF=0
|
||||||
pop esi
|
pop esi
|
||||||
ret
|
ret
|
||||||
@@ -1915,6 +1920,304 @@ fs_FloppyRewrite:
|
|||||||
pop edi ecx
|
pop edi ecx
|
||||||
jmp .ret
|
jmp .ret
|
||||||
|
|
||||||
|
;----------------------------------------------------------------
|
||||||
|
;
|
||||||
|
; fs_FloppyWrite - LFN variant for writing to floppy
|
||||||
|
;
|
||||||
|
; esi points to filename
|
||||||
|
; ebx pointer to 64-bit number = first wanted byte, 0+
|
||||||
|
; may be ebx=0 - start from first byte
|
||||||
|
; ecx number of bytes to write, 0+
|
||||||
|
; edx mem location to data
|
||||||
|
;
|
||||||
|
; ret ebx = bytes written (maybe 0)
|
||||||
|
; eax = 0 ok write or other = errormsg
|
||||||
|
;
|
||||||
|
;--------------------------------------------------------------
|
||||||
|
|
||||||
|
@@:
|
||||||
|
push ERROR_ACCESS_DENIED
|
||||||
|
fs_FloppyWrite.ret0:
|
||||||
|
pop eax
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
|
||||||
|
fs_FloppyWrite.ret11:
|
||||||
|
push 11
|
||||||
|
jmp fs_FloppyWrite.ret0
|
||||||
|
|
||||||
|
fs_FloppyWrite:
|
||||||
|
cmp byte [esi], 0
|
||||||
|
jz @b
|
||||||
|
call read_flp_fat
|
||||||
|
cmp [FDC_Status], 0
|
||||||
|
jnz .ret11
|
||||||
|
pushad
|
||||||
|
call fd_find_lfn
|
||||||
|
jnc .found
|
||||||
|
popad
|
||||||
|
push ERROR_FILE_NOT_FOUND
|
||||||
|
jmp .ret0
|
||||||
|
.found:
|
||||||
|
; FAT does not support files larger than 4GB
|
||||||
|
test ebx, ebx
|
||||||
|
jz .l1
|
||||||
|
cmp dword [ebx+4], 0
|
||||||
|
jz @f
|
||||||
|
.eof:
|
||||||
|
popad
|
||||||
|
push ERROR_END_OF_FILE
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
mov ebx, [ebx]
|
||||||
|
.l1:
|
||||||
|
; now edi points to direntry, ebx=start byte to write,
|
||||||
|
; ecx=number of bytes to write, edx=data pointer
|
||||||
|
|
||||||
|
; extend file if needed
|
||||||
|
add ecx, ebx
|
||||||
|
jc .eof ; FAT does not support files larger than 4GB
|
||||||
|
push eax ; save directory cluster
|
||||||
|
push 0 ; return value=0
|
||||||
|
|
||||||
|
call get_time_for_file
|
||||||
|
mov [edi+22], ax ; last write time
|
||||||
|
call get_date_for_file
|
||||||
|
mov [edi+24], ax ; last write date
|
||||||
|
mov [edi+18], ax ; last access date
|
||||||
|
|
||||||
|
push dword [edi+28] ; save current file size
|
||||||
|
cmp ecx, [edi+28]
|
||||||
|
jbe .length_ok
|
||||||
|
cmp ecx, ebx
|
||||||
|
jz .length_ok
|
||||||
|
call floppy_extend_file
|
||||||
|
jnc .length_ok
|
||||||
|
mov [esp+4], eax
|
||||||
|
; floppy_extend_file can return two error codes: FAT table error or disk full.
|
||||||
|
; First case is fatal error, in second case we may write some data
|
||||||
|
cmp al, ERROR_DISK_FULL
|
||||||
|
jz .disk_full
|
||||||
|
pop eax
|
||||||
|
pop eax
|
||||||
|
mov [esp+4+28], eax
|
||||||
|
pop eax
|
||||||
|
popad
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
.disk_full:
|
||||||
|
; correct number of bytes to write
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
cmp ecx, ebx
|
||||||
|
ja .length_ok
|
||||||
|
.ret:
|
||||||
|
pop eax
|
||||||
|
pop eax
|
||||||
|
mov [esp+4+28], eax ; eax=return value
|
||||||
|
pop eax
|
||||||
|
sub edx, [esp+20]
|
||||||
|
mov [esp+16], edx ; ebx=number of written bytes
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
.length_ok:
|
||||||
|
; save FAT & directory
|
||||||
|
; note that directory must be saved first because save_flp_fat uses buffer at 0xD000
|
||||||
|
mov esi, [edi+28]
|
||||||
|
movzx edi, word [edi+26] ; starting cluster
|
||||||
|
mov eax, [esp+8]
|
||||||
|
pusha
|
||||||
|
call save_chs_sector
|
||||||
|
popa
|
||||||
|
cmp [FDC_Status], 0
|
||||||
|
jnz .device_err
|
||||||
|
call save_flp_fat
|
||||||
|
cmp [FDC_Status], 0
|
||||||
|
jz @f
|
||||||
|
.device_err:
|
||||||
|
mov byte [esp+4], 11
|
||||||
|
jmp .ret
|
||||||
|
@@:
|
||||||
|
|
||||||
|
; now ebx=start pos, ecx=end pos, both lie inside file
|
||||||
|
sub ecx, ebx
|
||||||
|
jz .ret
|
||||||
|
call SetUserInterrupts
|
||||||
|
.write_loop:
|
||||||
|
lea eax, [edi+31] ; current sector
|
||||||
|
; get length of data in current sector
|
||||||
|
push ecx
|
||||||
|
sub ebx, 0x200
|
||||||
|
jb .hasdata
|
||||||
|
neg ebx
|
||||||
|
xor ecx, ecx
|
||||||
|
jmp @f
|
||||||
|
.hasdata:
|
||||||
|
neg ebx
|
||||||
|
cmp ecx, ebx
|
||||||
|
jbe @f
|
||||||
|
mov ecx, ebx
|
||||||
|
@@:
|
||||||
|
; load sector if needed
|
||||||
|
cmp dword [esp+4], 0 ; we don't need to read uninitialized data
|
||||||
|
jz .noread
|
||||||
|
cmp ecx, 0x200 ; we don't need to read sector if it is fully rewritten
|
||||||
|
jz .noread
|
||||||
|
cmp ecx, esi ; (same for the last sector)
|
||||||
|
jz .noread
|
||||||
|
pusha
|
||||||
|
call read_chs_sector
|
||||||
|
popa
|
||||||
|
cmp [FDC_Status], 0
|
||||||
|
jz @f
|
||||||
|
.device_err2:
|
||||||
|
pop ecx
|
||||||
|
jmp .device_err
|
||||||
|
@@:
|
||||||
|
.noread:
|
||||||
|
; zero uninitialized data if file was extended (because floppy_extend_file does not this)
|
||||||
|
push eax ecx edi
|
||||||
|
xor eax, eax
|
||||||
|
mov ecx, 0x200
|
||||||
|
sub ecx, [esp+4+12]
|
||||||
|
jbe @f
|
||||||
|
mov edi, 0xD000
|
||||||
|
add edi, [esp+4+12]
|
||||||
|
rep stosb
|
||||||
|
@@:
|
||||||
|
; zero uninitialized data in the last sector
|
||||||
|
mov ecx, 0x200
|
||||||
|
sub ecx, esi
|
||||||
|
jbe @f
|
||||||
|
mov edi, 0xD000
|
||||||
|
add edi, esi
|
||||||
|
rep stosb
|
||||||
|
@@:
|
||||||
|
pop edi ecx eax
|
||||||
|
; copy new data
|
||||||
|
push eax
|
||||||
|
mov eax, edx
|
||||||
|
neg ebx
|
||||||
|
jecxz @f
|
||||||
|
add ebx, 0xD000+0x200
|
||||||
|
call memmove
|
||||||
|
xor ebx, ebx
|
||||||
|
@@:
|
||||||
|
pop eax
|
||||||
|
; save sector
|
||||||
|
pusha
|
||||||
|
call save_chs_sector
|
||||||
|
popa
|
||||||
|
cmp [FDC_Status], 0
|
||||||
|
jnz .device_err2
|
||||||
|
add edx, ecx
|
||||||
|
sub [esp], ecx
|
||||||
|
pop ecx
|
||||||
|
jz .done
|
||||||
|
.next_cluster:
|
||||||
|
movzx edi, word [edi*2+0x282000]
|
||||||
|
sub esi, 0x200
|
||||||
|
jae @f
|
||||||
|
xor esi, esi
|
||||||
|
@@:
|
||||||
|
sub dword [esp], 0x200
|
||||||
|
jae .write_loop
|
||||||
|
and dword [esp], 0
|
||||||
|
jmp .write_loop
|
||||||
|
.done:
|
||||||
|
mov [fdc_irq_func], fdc_null
|
||||||
|
jmp .ret
|
||||||
|
|
||||||
|
floppy_extend_file.zero_size:
|
||||||
|
xor eax, eax
|
||||||
|
jmp floppy_extend_file.start_extend
|
||||||
|
|
||||||
|
; extends file on floppy to given size (new data area is undefined)
|
||||||
|
; in: edi->direntry, ecx=new size
|
||||||
|
; out: CF=0 => OK, eax destroyed
|
||||||
|
; CF=1 => error, eax=code (ERROR_FAT_TABLE or ERROR_DISK_FULL)
|
||||||
|
floppy_extend_file:
|
||||||
|
push ecx
|
||||||
|
; find the last cluster of file
|
||||||
|
movzx eax, word [edi+26] ; first cluster
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
jecxz .zero_size
|
||||||
|
@@:
|
||||||
|
sub ecx, 0x200
|
||||||
|
jbe @f
|
||||||
|
mov eax, [eax*2+0x282000]
|
||||||
|
and eax, 0xFFF
|
||||||
|
jz .fat_err
|
||||||
|
cmp eax, 0xFF8
|
||||||
|
jb @b
|
||||||
|
.fat_err:
|
||||||
|
pop ecx
|
||||||
|
push ERROR_FAT_TABLE
|
||||||
|
pop eax
|
||||||
|
stc
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
push eax
|
||||||
|
mov eax, [eax*2+0x282000]
|
||||||
|
and eax, 0xFFF
|
||||||
|
cmp eax, 0xFF8
|
||||||
|
pop eax
|
||||||
|
jb .fat_err
|
||||||
|
; set length to full number of sectors
|
||||||
|
sub [edi+28], ecx
|
||||||
|
.start_extend:
|
||||||
|
pop ecx
|
||||||
|
; now do extend
|
||||||
|
push edx esi
|
||||||
|
mov esi, 0x282000+2*2 ; start scan from cluster 2
|
||||||
|
mov edx, 2847 ; number of clusters to scan
|
||||||
|
.extend_loop:
|
||||||
|
cmp [edi+28], ecx
|
||||||
|
jae .extend_done
|
||||||
|
; add new sector
|
||||||
|
push ecx
|
||||||
|
push edi
|
||||||
|
.scan:
|
||||||
|
mov ecx, edx
|
||||||
|
mov edi, esi
|
||||||
|
jecxz .disk_full
|
||||||
|
push eax
|
||||||
|
xor eax, eax
|
||||||
|
repnz scasw
|
||||||
|
pop eax
|
||||||
|
jnz .disk_full
|
||||||
|
mov word [edi-2], 0xFFF
|
||||||
|
mov esi, edi
|
||||||
|
mov edx, ecx
|
||||||
|
sub edi, 0x282000
|
||||||
|
shr edi, 1
|
||||||
|
dec edi ; now edi=new cluster
|
||||||
|
test eax, eax
|
||||||
|
jz .first_cluster
|
||||||
|
mov [0x282000+eax*2], di
|
||||||
|
jmp @f
|
||||||
|
.first_cluster:
|
||||||
|
pop eax ; eax->direntry
|
||||||
|
push eax
|
||||||
|
mov [eax+26], di
|
||||||
|
@@:
|
||||||
|
mov eax, edi ; eax=new cluster
|
||||||
|
pop edi ; edi->direntry
|
||||||
|
pop ecx ; ecx=required size
|
||||||
|
add dword [edi+28], 0x200
|
||||||
|
jmp .extend_loop
|
||||||
|
.extend_done:
|
||||||
|
mov [edi+28], ecx
|
||||||
|
pop esi edx
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
.disk_full:
|
||||||
|
pop edi ecx
|
||||||
|
pop esi edx
|
||||||
|
stc
|
||||||
|
push ERROR_DISK_FULL
|
||||||
|
pop eax
|
||||||
|
ret
|
||||||
|
|
||||||
fs_FloppyGetFileInfo:
|
fs_FloppyGetFileInfo:
|
||||||
call read_flp_fat
|
call read_flp_fat
|
||||||
cmp [FDC_Status], 0
|
cmp [FDC_Status], 0
|
||||||
@@ -1951,16 +2254,9 @@ fs_FloppySetFileInfo:
|
|||||||
push eax
|
push eax
|
||||||
call bdfe_to_fat_entry
|
call bdfe_to_fat_entry
|
||||||
pop eax
|
pop eax
|
||||||
test eax, eax
|
|
||||||
jz .root
|
|
||||||
add eax, 31
|
|
||||||
pusha
|
pusha
|
||||||
call save_chs_sector
|
call save_chs_sector
|
||||||
popa
|
popa
|
||||||
jmp .cmn
|
|
||||||
.root:
|
|
||||||
call save_flp_root
|
|
||||||
.cmn:
|
|
||||||
pop edi
|
pop edi
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
cmp [FDC_Status], 0
|
cmp [FDC_Status], 0
|
||||||
|
@@ -2,11 +2,12 @@
|
|||||||
;; ;;
|
;; ;;
|
||||||
;; FAT32.INC ;;
|
;; FAT32.INC ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; FAT16/32 functions for MenuetOS ;;
|
;; FAT16/32 functions for KolibriOS ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Copyright 2002 Paolo Minazzi, paolo.minazzi@inwind.it ;;
|
;; Copyright 2002 Paolo Minazzi, paolo.minazzi@inwind.it ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; See file COPYING for details ;;
|
;; See file COPYING for details ;;
|
||||||
|
;; 17.08.2006 LFN write/append to file - diamond ;;
|
||||||
;; 23.06.2006 LFN start application - diamond ;;
|
;; 23.06.2006 LFN start application - diamond ;;
|
||||||
;; 15.06.2006 LFN get/set file/folder info - diamond ;;
|
;; 15.06.2006 LFN get/set file/folder info - diamond ;;
|
||||||
;; 27.05.2006 LFN create/rewrite file - diamond ;;
|
;; 27.05.2006 LFN create/rewrite file - diamond ;;
|
||||||
@@ -104,7 +105,6 @@ uglobal
|
|||||||
startpath: times 255 db 0
|
startpath: times 255 db 0
|
||||||
|
|
||||||
fat16_root db 0 ; flag for fat16 rootdir
|
fat16_root db 0 ; flag for fat16 rootdir
|
||||||
f_del db 0 ; 1=overwrite fat entry
|
|
||||||
fat_change db 0 ; 1=fat has changed
|
fat_change db 0 ; 1=fat has changed
|
||||||
|
|
||||||
endg
|
endg
|
||||||
@@ -225,27 +225,12 @@ set_FAT:
|
|||||||
cmp [fat_type],16
|
cmp [fat_type],16
|
||||||
jne sfc_test32
|
jne sfc_test32
|
||||||
|
|
||||||
cmp [f_del],1 ; overwrite previous value?
|
|
||||||
je sfc_set16 ; yes
|
|
||||||
cmp word [ebx+esi],0 ; is cluster free?
|
|
||||||
je sfc_set16 ; yes
|
|
||||||
mov dword [8*0x100000],0xffffff
|
|
||||||
mov edx,[ebx+esi] ; get old value
|
|
||||||
jmp sfc_nonzero
|
|
||||||
|
|
||||||
sfc_set16:
|
sfc_set16:
|
||||||
xchg [ebx+esi],dx ; save new value and get old value
|
xchg [ebx+esi],dx ; save new value and get old value
|
||||||
jmp sfc_write
|
jmp sfc_write
|
||||||
|
|
||||||
sfc_test32:
|
sfc_test32:
|
||||||
mov eax,[fatMASK]
|
mov eax,[fatMASK]
|
||||||
cmp [f_del],1 ; overwrite previous value?
|
|
||||||
je sfc_set32 ; yes
|
|
||||||
test eax,[ebx+esi] ; is cluster free?
|
|
||||||
je sfc_set32 ; yes
|
|
||||||
mov dword [8*0x100000],0xffffff
|
|
||||||
mov edx,[ebx+esi] ; get old value
|
|
||||||
jmp sfc_nonzero
|
|
||||||
|
|
||||||
sfc_set32:
|
sfc_set32:
|
||||||
and edx,eax
|
and edx,eax
|
||||||
@@ -554,13 +539,10 @@ analyze_directory_to_write:
|
|||||||
push eax ; save new cluster
|
push eax ; save new cluster
|
||||||
mov edx,eax
|
mov edx,eax
|
||||||
mov eax,[cluster_tmp] ; change last cluster to point new cluster
|
mov eax,[cluster_tmp] ; change last cluster to point new cluster
|
||||||
mov [f_del],1
|
|
||||||
call set_FAT
|
call set_FAT
|
||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
jne adw_not_found_1
|
jne adw_not_found_1
|
||||||
|
|
||||||
mov [f_del],0
|
|
||||||
|
|
||||||
mov ecx,-1 ; remove 1 cluster from free disk space
|
mov ecx,-1 ; remove 1 cluster from free disk space
|
||||||
call add_disk_free_space
|
call add_disk_free_space
|
||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
@@ -883,13 +865,10 @@ makedir:
|
|||||||
jne make_dir_error_1
|
jne make_dir_error_1
|
||||||
mov eax,[cluster] ; directory cluster
|
mov eax,[cluster] ; directory cluster
|
||||||
xor edx,edx ; free
|
xor edx,edx ; free
|
||||||
mov [f_del],1
|
|
||||||
call set_FAT
|
call set_FAT
|
||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
jne make_dir_error_1
|
jne make_dir_error_1
|
||||||
|
|
||||||
mov [f_del],0
|
|
||||||
|
|
||||||
popad
|
popad
|
||||||
call update_disk ; write all of cache and fat to hd
|
call update_disk ; write all of cache and fat to hd
|
||||||
make_dir_error_2:
|
make_dir_error_2:
|
||||||
@@ -1238,12 +1217,10 @@ file_append:
|
|||||||
|
|
||||||
mov edx,eax
|
mov edx,eax
|
||||||
mov eax,[cluster]
|
mov eax,[cluster]
|
||||||
mov [f_del],1
|
|
||||||
call set_FAT ; update previous cluster
|
call set_FAT ; update previous cluster
|
||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
jne append_access_1
|
jne append_access_1
|
||||||
|
|
||||||
mov [f_del],0
|
|
||||||
pop eax
|
pop eax
|
||||||
jmp append_remove_free
|
jmp append_remove_free
|
||||||
|
|
||||||
@@ -1362,12 +1339,10 @@ file_append:
|
|||||||
|
|
||||||
truncate_pos_found:
|
truncate_pos_found:
|
||||||
mov edx,[fatEND] ; new end for cluster chain
|
mov edx,[fatEND] ; new end for cluster chain
|
||||||
mov [f_del],1
|
|
||||||
call set_FAT
|
call set_FAT
|
||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
jne append_access
|
jne append_access
|
||||||
|
|
||||||
mov [f_del],0
|
|
||||||
mov eax,edx ; clear rest of chain
|
mov eax,edx ; clear rest of chain
|
||||||
|
|
||||||
truncate_clear_chain:
|
truncate_clear_chain:
|
||||||
@@ -1875,7 +1850,6 @@ clear_cluster_chain:
|
|||||||
;-----------------------------------------------------
|
;-----------------------------------------------------
|
||||||
push eax ecx edx
|
push eax ecx edx
|
||||||
xor ecx,ecx ; cluster count
|
xor ecx,ecx ; cluster count
|
||||||
mov [f_del],1 ; delete on
|
|
||||||
|
|
||||||
clean_new_chain:
|
clean_new_chain:
|
||||||
cmp eax,[LAST_CLUSTER] ; end of file
|
cmp eax,[LAST_CLUSTER] ; end of file
|
||||||
@@ -1897,7 +1871,6 @@ clear_cluster_chain:
|
|||||||
delete_OK:
|
delete_OK:
|
||||||
call add_disk_free_space ; add clusters to free disk space
|
call add_disk_free_space ; add clusters to free disk space
|
||||||
access_denied_01:
|
access_denied_01:
|
||||||
mov [f_del],0
|
|
||||||
pop edx ecx eax
|
pop edx ecx eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -3288,7 +3261,6 @@ fat_notroot_extend_dir:
|
|||||||
mov eax, [esp+4]
|
mov eax, [esp+4]
|
||||||
mov eax, [eax]
|
mov eax, [eax]
|
||||||
push edx
|
push edx
|
||||||
mov [f_del], 1
|
|
||||||
call set_FAT
|
call set_FAT
|
||||||
pop edx
|
pop edx
|
||||||
cmp [hd_error], 0
|
cmp [hd_error], 0
|
||||||
@@ -3450,7 +3422,6 @@ fs_HdRewrite:
|
|||||||
mov word [edi+26], cx
|
mov word [edi+26], cx
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz .done1
|
jz .done1
|
||||||
mov [f_del], 1
|
|
||||||
@@:
|
@@:
|
||||||
cmp eax, [fatRESERVED]
|
cmp eax, [fatRESERVED]
|
||||||
jae .done1
|
jae .done1
|
||||||
@@ -3736,7 +3707,6 @@ fs_HdRewrite:
|
|||||||
mov ecx, eax
|
mov ecx, eax
|
||||||
call get_free_FAT
|
call get_free_FAT
|
||||||
jc .diskfull
|
jc .diskfull
|
||||||
mov [f_del], 1
|
|
||||||
push edx
|
push edx
|
||||||
mov edx, [fatEND]
|
mov edx, [fatEND]
|
||||||
call set_FAT
|
call set_FAT
|
||||||
@@ -3783,6 +3753,348 @@ fs_HdRewrite:
|
|||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
;----------------------------------------------------------------
|
||||||
|
;
|
||||||
|
; fs_HdWrite - LFN variant for writing to floppy
|
||||||
|
;
|
||||||
|
; esi points to filename
|
||||||
|
; ebx pointer to 64-bit number = first wanted byte, 0+
|
||||||
|
; may be ebx=0 - start from first byte
|
||||||
|
; ecx number of bytes to write, 0+
|
||||||
|
; edx mem location to data
|
||||||
|
;
|
||||||
|
; ret ebx = bytes written (maybe 0)
|
||||||
|
; eax = 0 ok write or other = errormsg
|
||||||
|
;
|
||||||
|
;--------------------------------------------------------------
|
||||||
|
fs_HdWrite.access_denied:
|
||||||
|
push ERROR_ACCESS_DENIED
|
||||||
|
fs_HdWrite.ret0:
|
||||||
|
pop eax
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
|
||||||
|
fs_HdWrite.ret11:
|
||||||
|
push 11
|
||||||
|
jmp fs_HdWrite.ret0
|
||||||
|
|
||||||
|
fs_HdWrite:
|
||||||
|
cmp [fat_type], 0
|
||||||
|
jnz @f
|
||||||
|
push ERROR_UNKNOWN_FS
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
cmp byte [esi], 0
|
||||||
|
jz .access_denied
|
||||||
|
pushad
|
||||||
|
call hd_find_lfn
|
||||||
|
pushfd
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
popfd
|
||||||
|
popad
|
||||||
|
push 11
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
popfd
|
||||||
|
jnc .found
|
||||||
|
popad
|
||||||
|
push ERROR_FILE_NOT_FOUND
|
||||||
|
jmp .ret0
|
||||||
|
.found:
|
||||||
|
; FAT does not support files larger than 4GB
|
||||||
|
test ebx, ebx
|
||||||
|
jz .l1
|
||||||
|
cmp dword [ebx+4], 0
|
||||||
|
jz @f
|
||||||
|
.eof:
|
||||||
|
popad
|
||||||
|
push ERROR_END_OF_FILE
|
||||||
|
jmp .ret0
|
||||||
|
@@:
|
||||||
|
mov ebx, [ebx]
|
||||||
|
.l1:
|
||||||
|
; now edi points to direntry, ebx=start byte to write,
|
||||||
|
; ecx=number of bytes to write, edx=data pointer
|
||||||
|
|
||||||
|
; extend file if needed
|
||||||
|
add ecx, ebx
|
||||||
|
jc .eof ; FAT does not support files larger than 4GB
|
||||||
|
push eax ; save directory sector
|
||||||
|
push 0 ; return value=0
|
||||||
|
|
||||||
|
call get_time_for_file
|
||||||
|
mov [edi+22], ax ; last write time
|
||||||
|
call get_date_for_file
|
||||||
|
mov [edi+24], ax ; last write date
|
||||||
|
mov [edi+18], ax ; last access date
|
||||||
|
|
||||||
|
push dword [edi+28] ; save current file size
|
||||||
|
cmp ecx, [edi+28]
|
||||||
|
jbe .length_ok
|
||||||
|
cmp ecx, ebx
|
||||||
|
jz .length_ok
|
||||||
|
call hd_extend_file
|
||||||
|
jnc .length_ok
|
||||||
|
mov [esp+4], eax
|
||||||
|
; hd_extend_file can return three error codes: FAT table error, device error or disk full.
|
||||||
|
; First two cases are fatal errors, in third case we may write some data
|
||||||
|
cmp al, ERROR_DISK_FULL
|
||||||
|
jz .disk_full
|
||||||
|
pop eax
|
||||||
|
pop eax
|
||||||
|
mov [esp+4+28], eax
|
||||||
|
pop eax
|
||||||
|
popad
|
||||||
|
xor ebx, ebx
|
||||||
|
ret
|
||||||
|
.disk_full:
|
||||||
|
; correct number of bytes to write
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
cmp ecx, ebx
|
||||||
|
ja .length_ok
|
||||||
|
.ret:
|
||||||
|
call update_disk
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
mov byte [esp+4], 11
|
||||||
|
@@:
|
||||||
|
pop eax
|
||||||
|
pop eax
|
||||||
|
mov [esp+4+28], eax ; eax=return value
|
||||||
|
pop eax
|
||||||
|
sub edx, [esp+20]
|
||||||
|
mov [esp+16], edx ; ebx=number of written bytes
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
.length_ok:
|
||||||
|
mov esi, [edi+28]
|
||||||
|
mov eax, [edi+20-2]
|
||||||
|
mov ax, [edi+26]
|
||||||
|
mov edi, eax ; edi=current cluster
|
||||||
|
xor ebp, ebp ; ebp=current sector in cluster
|
||||||
|
; save directory
|
||||||
|
mov eax, [esp+8]
|
||||||
|
push ebx
|
||||||
|
mov ebx, buffer
|
||||||
|
call hd_write
|
||||||
|
pop ebx
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
.device_err:
|
||||||
|
mov byte [esp+4], 11
|
||||||
|
jmp .ret
|
||||||
|
@@:
|
||||||
|
|
||||||
|
; now ebx=start pos, ecx=end pos, both lie inside file
|
||||||
|
sub ecx, ebx
|
||||||
|
jz .ret
|
||||||
|
.write_loop:
|
||||||
|
; get length of data in current sector
|
||||||
|
push ecx
|
||||||
|
sub ebx, 0x200
|
||||||
|
jb .hasdata
|
||||||
|
neg ebx
|
||||||
|
xor ecx, ecx
|
||||||
|
jmp @f
|
||||||
|
.hasdata:
|
||||||
|
neg ebx
|
||||||
|
cmp ecx, ebx
|
||||||
|
jbe @f
|
||||||
|
mov ecx, ebx
|
||||||
|
@@:
|
||||||
|
; get current sector number
|
||||||
|
mov eax, edi
|
||||||
|
dec eax
|
||||||
|
dec eax
|
||||||
|
imul eax, [SECTORS_PER_CLUSTER]
|
||||||
|
add eax, [DATA_START]
|
||||||
|
add eax, ebp
|
||||||
|
; load sector if needed
|
||||||
|
cmp dword [esp+4], 0 ; we don't need to read uninitialized data
|
||||||
|
jz .noread
|
||||||
|
cmp ecx, 0x200 ; we don't need to read sector if it is fully rewritten
|
||||||
|
jz .noread
|
||||||
|
cmp ecx, esi ; (same for the last sector)
|
||||||
|
jz .noread
|
||||||
|
push ebx
|
||||||
|
mov ebx, buffer
|
||||||
|
call hd_read
|
||||||
|
pop ebx
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
.device_err2:
|
||||||
|
pop ecx
|
||||||
|
jmp .device_err
|
||||||
|
@@:
|
||||||
|
.noread:
|
||||||
|
; zero uninitialized data if file was extended (because hd_extend_file does not this)
|
||||||
|
push eax ecx edi
|
||||||
|
xor eax, eax
|
||||||
|
mov ecx, 0x200
|
||||||
|
sub ecx, [esp+4+12]
|
||||||
|
jbe @f
|
||||||
|
mov edi, buffer
|
||||||
|
add edi, [esp+4+12]
|
||||||
|
rep stosb
|
||||||
|
@@:
|
||||||
|
; zero uninitialized data in the last sector
|
||||||
|
mov ecx, 0x200
|
||||||
|
sub ecx, esi
|
||||||
|
jbe @f
|
||||||
|
mov edi, buffer
|
||||||
|
add edi, esi
|
||||||
|
rep stosb
|
||||||
|
@@:
|
||||||
|
pop edi ecx eax
|
||||||
|
; copy new data
|
||||||
|
push eax
|
||||||
|
mov eax, edx
|
||||||
|
neg ebx
|
||||||
|
jecxz @f
|
||||||
|
add ebx, buffer+0x200
|
||||||
|
call memmove
|
||||||
|
xor ebx, ebx
|
||||||
|
@@:
|
||||||
|
pop eax
|
||||||
|
; save sector
|
||||||
|
push ebx
|
||||||
|
mov ebx, buffer
|
||||||
|
call hd_write
|
||||||
|
pop ebx
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jnz .device_err2
|
||||||
|
add edx, ecx
|
||||||
|
sub [esp], ecx
|
||||||
|
pop ecx
|
||||||
|
jz .ret
|
||||||
|
; next sector
|
||||||
|
inc ebp
|
||||||
|
cmp ebp, [SECTORS_PER_CLUSTER]
|
||||||
|
jb @f
|
||||||
|
xor ebp, ebp
|
||||||
|
mov eax, edi
|
||||||
|
call get_FAT
|
||||||
|
mov edi, eax
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jnz .device_err
|
||||||
|
@@:
|
||||||
|
sub esi, 0x200
|
||||||
|
jae @f
|
||||||
|
xor esi, esi
|
||||||
|
@@:
|
||||||
|
sub dword [esp], 0x200
|
||||||
|
jae @f
|
||||||
|
and dword [esp], 0
|
||||||
|
@@: jmp .write_loop
|
||||||
|
|
||||||
|
hd_extend_file.zero_size:
|
||||||
|
xor eax, eax
|
||||||
|
jmp hd_extend_file.start_extend
|
||||||
|
|
||||||
|
; extends file on hd to given size (new data area is undefined)
|
||||||
|
; in: edi->direntry, ecx=new size
|
||||||
|
; out: CF=0 => OK, eax destroyed
|
||||||
|
; CF=1 => error, eax=code (ERROR_FAT_TABLE or ERROR_DISK_FULL or 11)
|
||||||
|
hd_extend_file:
|
||||||
|
push ebp
|
||||||
|
mov ebp, [SECTORS_PER_CLUSTER]
|
||||||
|
imul ebp, [BYTES_PER_SECTOR]
|
||||||
|
push ecx
|
||||||
|
; find the last cluster of file
|
||||||
|
mov eax, [edi+20-2]
|
||||||
|
mov ax, [edi+26]
|
||||||
|
mov ecx, [edi+28]
|
||||||
|
jecxz .zero_size
|
||||||
|
.last_loop:
|
||||||
|
sub ecx, ebp
|
||||||
|
jbe .last_found
|
||||||
|
call get_FAT
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
.device_err:
|
||||||
|
pop ecx
|
||||||
|
.device_err2:
|
||||||
|
pop ebp
|
||||||
|
push 11
|
||||||
|
.ret_err:
|
||||||
|
pop eax
|
||||||
|
stc
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
cmp eax, 2
|
||||||
|
jb .fat_err
|
||||||
|
cmp eax, [fatRESERVED]
|
||||||
|
jb .last_loop
|
||||||
|
.fat_err:
|
||||||
|
pop ecx ebp
|
||||||
|
push ERROR_FAT_TABLE
|
||||||
|
jmp .ret_err
|
||||||
|
.last_found:
|
||||||
|
push eax
|
||||||
|
call get_FAT
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
pop eax
|
||||||
|
jmp .device_err
|
||||||
|
@@:
|
||||||
|
cmp eax, [fatRESERVED]
|
||||||
|
pop eax
|
||||||
|
jb .fat_err
|
||||||
|
; set length to full number of clusters
|
||||||
|
sub [edi+28], ecx
|
||||||
|
.start_extend:
|
||||||
|
pop ecx
|
||||||
|
; now do extend
|
||||||
|
push edx
|
||||||
|
mov edx, 2 ; start scan from cluster 2
|
||||||
|
.extend_loop:
|
||||||
|
cmp [edi+28], ecx
|
||||||
|
jae .extend_done
|
||||||
|
; add new cluster
|
||||||
|
push eax
|
||||||
|
mov eax, edx
|
||||||
|
call get_free_FAT
|
||||||
|
jc .disk_full
|
||||||
|
mov edx, [fatEND]
|
||||||
|
call set_FAT
|
||||||
|
mov edx, eax
|
||||||
|
pop eax
|
||||||
|
test eax, eax
|
||||||
|
jz .first_cluster
|
||||||
|
push edx
|
||||||
|
call set_FAT
|
||||||
|
pop edx
|
||||||
|
jmp @f
|
||||||
|
.first_cluster:
|
||||||
|
ror edx, 16
|
||||||
|
mov [edi+20], dx
|
||||||
|
ror edx, 16
|
||||||
|
mov [edi+26], dx
|
||||||
|
@@:
|
||||||
|
mov eax, edx
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jnz .device_err3
|
||||||
|
add [edi+28], ebp
|
||||||
|
jmp .extend_loop
|
||||||
|
.extend_done:
|
||||||
|
mov [edi+28], ecx
|
||||||
|
pop edx ebp
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
.device_err3:
|
||||||
|
pop edx
|
||||||
|
jmp .device_err2
|
||||||
|
.disk_full:
|
||||||
|
pop eax edx ebp
|
||||||
|
push ERROR_DISK_FULL
|
||||||
|
pop eax
|
||||||
|
cmp [hd_error], 0
|
||||||
|
jz @f
|
||||||
|
mov al, 11
|
||||||
|
@@: stc
|
||||||
|
ret
|
||||||
|
|
||||||
fs_HdGetFileInfo:
|
fs_HdGetFileInfo:
|
||||||
cmp [fat_type], 0
|
cmp [fat_type], 0
|
||||||
jnz @f
|
jnz @f
|
||||||
|
@@ -347,7 +347,7 @@ fs_RamdiskServices:
|
|||||||
dd fs_RamdiskRead
|
dd fs_RamdiskRead
|
||||||
dd fs_RamdiskReadFolder
|
dd fs_RamdiskReadFolder
|
||||||
dd fs_RamdiskRewrite
|
dd fs_RamdiskRewrite
|
||||||
dd fs_NotImplemented
|
dd fs_RamdiskWrite
|
||||||
dd fs_NotImplemented
|
dd fs_NotImplemented
|
||||||
dd fs_RamdiskGetFileInfo
|
dd fs_RamdiskGetFileInfo
|
||||||
dd fs_RamdiskSetFileInfo
|
dd fs_RamdiskSetFileInfo
|
||||||
@@ -376,7 +376,7 @@ fs_FloppyServices:
|
|||||||
dd fs_FloppyRead
|
dd fs_FloppyRead
|
||||||
dd fs_FloppyReadFolder
|
dd fs_FloppyReadFolder
|
||||||
dd fs_FloppyRewrite
|
dd fs_FloppyRewrite
|
||||||
dd fs_NotImplemented
|
dd fs_FloppyWrite
|
||||||
dd fs_NotImplemented
|
dd fs_NotImplemented
|
||||||
dd fs_FloppyGetFileInfo
|
dd fs_FloppyGetFileInfo
|
||||||
dd fs_FloppySetFileInfo
|
dd fs_FloppySetFileInfo
|
||||||
@@ -447,7 +447,7 @@ fs_HdServices:
|
|||||||
dd fs_HdRead
|
dd fs_HdRead
|
||||||
dd fs_HdReadFolder
|
dd fs_HdReadFolder
|
||||||
dd fs_HdRewrite
|
dd fs_HdRewrite
|
||||||
dd fs_NotImplemented
|
dd fs_HdWrite
|
||||||
dd fs_NotImplemented
|
dd fs_NotImplemented
|
||||||
dd fs_HdGetFileInfo
|
dd fs_HdGetFileInfo
|
||||||
dd fs_HdSetFileInfo
|
dd fs_HdSetFileInfo
|
||||||
|
@@ -570,6 +570,12 @@ if ~ BGI_LEVEL eq KERNEL
|
|||||||
jg .nobold
|
jg .nobold
|
||||||
end if
|
end if
|
||||||
mov edx,[.color]
|
mov edx,[.color]
|
||||||
|
; \begin{diamond}[18.08.2006]
|
||||||
|
; starting from K0530 kernel interprets flag 0x1000000 as
|
||||||
|
; negate existing pixels colors, disregarding passed color
|
||||||
|
; we do not want this
|
||||||
|
and edx, 0xFFFFFF
|
||||||
|
; \end{diamond}[18.08.2006]
|
||||||
mov eax,38
|
mov eax,38
|
||||||
int 0x40
|
int 0x40
|
||||||
test ebp,BGI_BOLD
|
test ebp,BGI_BOLD
|
||||||
|
@@ -68,11 +68,10 @@ use32
|
|||||||
dd 0x0
|
dd 0x0
|
||||||
not1strun dd 0x0
|
not1strun dd 0x0
|
||||||
|
|
||||||
include 'lang.inc'
|
include 'lang.inc'
|
||||||
include 'macros.inc'
|
include 'macros.inc'
|
||||||
;include 'debug.inc'
|
;include 'debug.inc'
|
||||||
include 'bgifont.inc'
|
include 'bgifont.inc'
|
||||||
lang equ en;ru;en
|
|
||||||
|
|
||||||
START:
|
START:
|
||||||
mov [help],0
|
mov [help],0
|
||||||
|
@@ -1159,7 +1159,7 @@ help_window:
|
|||||||
add edx,14 ;help_text addr.
|
add edx,14 ;help_text addr.
|
||||||
add esi,37 ; = 51 - length 1 line
|
add esi,37 ; = 51 - length 1 line
|
||||||
mov ecx,0x00ffffff
|
mov ecx,0x00ffffff
|
||||||
mov edi,15
|
mov edi,(help_end-help_text)/51
|
||||||
@@:
|
@@:
|
||||||
add ebx,0x10
|
add ebx,0x10
|
||||||
int 0x40
|
int 0x40
|
||||||
@@ -1329,6 +1329,7 @@ db 0xEC,0xED,0xEE,0xEF
|
|||||||
;text for help_window
|
;text for help_window
|
||||||
help_label: db 'Help for HeEd.'
|
help_label: db 'Help for HeEd.'
|
||||||
help_text:
|
help_text:
|
||||||
|
if lang eq ru
|
||||||
db '1.HeEd <20> <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> ⮫쪮 <20><><EFBFBD><EFBFBD> ࠧ <20> '
|
db '1.HeEd <20> <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> ⮫쪮 <20><><EFBFBD><EFBFBD> ࠧ <20> '
|
||||||
db ' <20>㦭<EFBFBD><E3A6AD> <20><> ࠧ <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD>. '
|
db ' <20>㦭<EFBFBD><E3A6AD> <20><> ࠧ <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD>. '
|
||||||
db '2.<2E><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⨨ 䠩<><E4A0A9> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>-'
|
db '2.<2E><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⨨ 䠩<><E4A0A9> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>-'
|
||||||
@@ -1344,12 +1345,27 @@ help_text:
|
|||||||
db ' <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0<>80000, <20><> ࠧ<><E0A0A7><EFBFBD> 䠩<><E4A0A9> '
|
db ' <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0<>80000, <20><> ࠧ<><E0A0A7><EFBFBD> 䠩<><E4A0A9> '
|
||||||
db ' ࠢ<><E0A0A2> 0xFFFFFFFF. '
|
db ' ࠢ<><E0A0A2> 0xFFFFFFFF. '
|
||||||
db ' (<28><>. <20><><EFBFBD><EFBFBD> "About") '
|
db ' (<28><>. <20><><EFBFBD><EFBFBD> "About") '
|
||||||
|
else
|
||||||
|
db '1.HeEd can once open file and many times save it. '
|
||||||
|
db '2.To open file without extension it is required to '
|
||||||
|
db ' specify anyway as three spaces after a dot. '
|
||||||
|
db '3.File is opened when the button "Go" is pressed. '
|
||||||
|
db '4.Creation of new files in the menu is not provided'
|
||||||
|
db ' but you can edit... '
|
||||||
|
db '5.Only number of bytes which was file size when '
|
||||||
|
db ' opening is written to file. '
|
||||||
|
db '6.If you press "Go" with empty filename field, '
|
||||||
|
db ' memory starting from address 0x80000 is output, '
|
||||||
|
db ' but file size equals to 0xFFFFFFFF. '
|
||||||
|
db ' (see info "About") '
|
||||||
|
end if
|
||||||
help_end:
|
help_end:
|
||||||
;text for about_window
|
;text for about_window
|
||||||
about_label: db 'About this funny.'
|
about_label: db 'About this funny.'
|
||||||
about_text:
|
about_text:
|
||||||
|
if lang eq ru
|
||||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
||||||
db '<27> <20><><EFBFBD>-<2D><> <>: <20><><EFBFBD> <20>ࠪ<EFBFBD><E0A0AA><EFBFBD><EFBFBD>᪨ <20><> <20><>⨬<EFBFBD><E2A8AC><EFBFBD><EFBFBD><E0AEA2>,'
|
db '<27> <20><><EFBFBD>-<2D><> <>: <20><><EFBFBD> <20>ࠪ<EFBFBD><E0A0AA><EFBFBD><EFBFBD>᪨ <20><> <20><>⨬<EFBFBD><E2A8AC><EFBFBD><EFBFBD><E0AEA2>,'
|
||||||
db '⠪ <20><><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㤥<EFBFBD> <20><> ⠪ <20><> <><E1ABAE><EFBFBD>. <20><>ப<EFBFBD> '
|
db '⠪ <20><><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㤥<EFBFBD> <20><> ⠪ <20><> <><E1ABAE><EFBFBD>. <20><>ப<EFBFBD> '
|
||||||
db '<27><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>אַ <20><><EFBFBD><EFBFBD> <20><> <20><>㣮<EFBFBD>, '
|
db '<27><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>אַ <20><><EFBFBD><EFBFBD> <20><> <20><>㣮<EFBFBD>, '
|
||||||
db '<27>. <20>. <20> <20><><EFBFBD> <20>뢮<EFBFBD><EBA2AE> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD> <20><> mov esi,ࠧ<><E0A0A7><EFBFBD> <20> '
|
db '<27>. <20>. <20> <20><><EFBFBD> <20>뢮<EFBFBD><EBA2AE> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD> <20><> mov esi,ࠧ<><E0A0A7><EFBFBD> <20> '
|
||||||
@@ -1363,6 +1379,23 @@ about_text:
|
|||||||
db 'ப <20> GUI MeOS <20> <20><><EFBFBD>⮬<EFBFBD> <20><> <20><><EFBFBD>⥭<EFBFBD><E2A5AD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>-<2D><> '
|
db 'ப <20> GUI MeOS <20> <20><><EFBFBD>⮬<EFBFBD> <20><> <20><><EFBFBD>⥭<EFBFBD><E2A5AD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>-<2D><> '
|
||||||
db '<27><><EFBFBD><EFBFBD>襥, 祬 <20>ਬ<EFBFBD><E0A8AC>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ⥬<>, <20> <20><>-'
|
db '<27><><EFBFBD><EFBFBD>襥, 祬 <20>ਬ<EFBFBD><E0A8AC>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ⥬<>, <20> <20><>-'
|
||||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>. mailto:babalbes@yandex.ru '
|
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>. mailto:babalbes@yandex.ru '
|
||||||
|
else
|
||||||
|
db 'Some information for those who want add to this '
|
||||||
|
db 'something their own: the code is practically not '
|
||||||
|
db 'optimized, so investigation is not complicated. '
|
||||||
|
db 'Strings for menu buttons must rank after each other'
|
||||||
|
db 'as I use not mov esi,size and mov edx,address when '
|
||||||
|
db 'output but simply add offsets. For encodins and '
|
||||||
|
db 'file sizes for save, it remains only add buttons '
|
||||||
|
db 'with text in menu (at addition one should take into'
|
||||||
|
db 'account that buttons ID are recognized as dec ah '
|
||||||
|
db 'rather than cmp ah,ID). Nevertheless if study is '
|
||||||
|
db 'unpleasant, you can write and ask. This program has'
|
||||||
|
db 'been written in course of study GUI MeOS and does '
|
||||||
|
db 'not therefore pretend on some more than example. '
|
||||||
|
db 'Just this theme bothers, but I regret to delete. '
|
||||||
|
db ' mailto:babalbes@yandex.ru '
|
||||||
|
end if
|
||||||
about_end:
|
about_end:
|
||||||
|
|
||||||
I_END:
|
I_END:
|
||||||
|
@@ -20,8 +20,8 @@ lang equ ru
|
|||||||
;0.07 convbmp ~13.05.2004
|
;0.07 convbmp ~13.05.2004
|
||||||
;0.08 fps ~14.05.2004
|
;0.08 fps ~14.05.2004
|
||||||
;0.09 drawfbox ~03.06.2004
|
;0.09 drawfbox ~03.06.2004
|
||||||
;0.10 all macros optimized by halyavin, add at ~07.06.2004
|
;0.10 all macros optimized by Halyavin A., add at ~07.06.2004
|
||||||
;0.11 many macros optimized by halyavin, add at ~30.08.2004
|
;0.11 many macros optimized by Halyavin A., add at ~30.08.2004
|
||||||
;0.12 bmptoimg ~07.09.2004
|
;0.12 bmptoimg ~07.09.2004
|
||||||
;0.13 imgtoimg ~08.09.2004
|
;0.13 imgtoimg ~08.09.2004
|
||||||
;0.14 imgtoimg modify not brake bmp pict! ~09.09.2004
|
;0.14 imgtoimg modify not brake bmp pict! ~09.09.2004
|
||||||
@@ -369,8 +369,8 @@ end if
|
|||||||
;DrawBox
|
;DrawBox
|
||||||
macro drawfbox x,y,xs,ys,color
|
macro drawfbox x,y,xs,ys,color
|
||||||
{
|
{
|
||||||
wordstoreg ebx,x,xs ;x*65536+xs
|
words2reg ebx,x,xs ;x*65536+xs
|
||||||
wordstoreg ecx,y,ys ;y*65536+ys
|
words2reg ecx,y,ys ;y*65536+ys
|
||||||
mov edx,color
|
mov edx,color
|
||||||
mov eax,13
|
mov eax,13
|
||||||
int 0x40
|
int 0x40
|
||||||
@@ -385,8 +385,8 @@ local no_out_fps
|
|||||||
jmp spdat
|
jmp spdat
|
||||||
savetime dd 0
|
savetime dd 0
|
||||||
fps_cntr dd 0
|
fps_cntr dd 0
|
||||||
fps dd 0
|
fps dd 0
|
||||||
ttt dd 0
|
ttt dd 0
|
||||||
spdat:
|
spdat:
|
||||||
get_time:
|
get_time:
|
||||||
mov eax,3
|
mov eax,3
|
||||||
@@ -395,7 +395,7 @@ get_time:
|
|||||||
jne new_time
|
jne new_time
|
||||||
inc [fps_cntr]
|
inc [fps_cntr]
|
||||||
cmp dword [ttt],0
|
cmp dword [ttt],0
|
||||||
je out_fps
|
je out_fps
|
||||||
dec dword [ttt]
|
dec dword [ttt]
|
||||||
jmp no_out_fps
|
jmp no_out_fps
|
||||||
new_time:
|
new_time:
|
||||||
@@ -405,7 +405,7 @@ new_time:
|
|||||||
mov [fps_cntr],0
|
mov [fps_cntr],0
|
||||||
out_fps:
|
out_fps:
|
||||||
if ~(delcolor eq )
|
if ~(delcolor eq )
|
||||||
mov ebx,x*65536+30
|
mov ebx,x*65536+36
|
||||||
mov ecx,y*65536+7
|
mov ecx,y*65536+7
|
||||||
mov edx,delcolor
|
mov edx,delcolor
|
||||||
mov eax,13
|
mov eax,13
|
||||||
@@ -413,7 +413,7 @@ if ~(delcolor eq )
|
|||||||
end if
|
end if
|
||||||
mov dword [ttt],fps_show_frequency
|
mov dword [ttt],fps_show_frequency
|
||||||
mov eax,47
|
mov eax,47
|
||||||
mov ebx,5*65536
|
mov ebx,6*65536
|
||||||
; mov bl,0
|
; mov bl,0
|
||||||
mov edx,x*65536+y
|
mov edx,x*65536+y
|
||||||
mov esi,color
|
mov esi,color
|
||||||
@@ -427,44 +427,44 @@ _1dbounce_count=0;
|
|||||||
macro collimg img1_off,x1,y1,img2_off,x2,y2,otv
|
macro collimg img1_off,x1,y1,img2_off,x2,y2,otv
|
||||||
{
|
{
|
||||||
local bounce,exit,anot,bc,nbc
|
local bounce,exit,anot,bc,nbc
|
||||||
mov esi,[img1_off] ;xs1
|
mov esi,[img1_off] ;xs1
|
||||||
mov edi,[img2_off] ;ys2
|
mov edi,[img2_off] ;ys2
|
||||||
mov eax,x1 ;
|
mov eax,x1 ;
|
||||||
mov ebx,x2 ;
|
mov ebx,x2 ;
|
||||||
call _1dbounce
|
call _1dbounce
|
||||||
mov edx,ecx
|
mov edx,ecx
|
||||||
mov esi,[img1_off+4] ;ys1
|
mov esi,[img1_off+4] ;ys1
|
||||||
mov edi,[img2_off+4] ;ys2
|
mov edi,[img2_off+4] ;ys2
|
||||||
mov eax,y1 ;
|
mov eax,y1 ;
|
||||||
mov ebx,y2 ;
|
mov ebx,y2 ;
|
||||||
call _1dbounce
|
call _1dbounce
|
||||||
add edx,ecx
|
add edx,ecx
|
||||||
cmp edx,2
|
cmp edx,2
|
||||||
je bounce
|
je bounce
|
||||||
mov otv,0
|
mov otv,0
|
||||||
jmp exit
|
jmp exit
|
||||||
_1dbounce_count=_1dbounce_count+1
|
_1dbounce_count=_1dbounce_count+1
|
||||||
if _1dbounce_count = 1
|
if _1dbounce_count = 1
|
||||||
_1dbounce:
|
_1dbounce:
|
||||||
cmp ebx,eax
|
cmp ebx,eax
|
||||||
jb anot
|
jb anot
|
||||||
add eax,esi
|
add eax,esi
|
||||||
cmp eax,ebx
|
cmp eax,ebx
|
||||||
jbe nbc
|
jbe nbc
|
||||||
bc:
|
bc:
|
||||||
mov ecx,1
|
mov ecx,1
|
||||||
ret
|
ret
|
||||||
anot:
|
anot:
|
||||||
add ebx,edi
|
add ebx,edi
|
||||||
cmp ebx,eax
|
cmp ebx,eax
|
||||||
ja bc
|
ja bc
|
||||||
nbc:
|
nbc:
|
||||||
xor ecx,ecx
|
xor ecx,ecx
|
||||||
ret
|
ret
|
||||||
end if
|
end if
|
||||||
bounce:
|
bounce:
|
||||||
mov otv,1
|
mov otv,1
|
||||||
exit:
|
exit:
|
||||||
}
|
}
|
||||||
|
|
||||||
macro rgbtobgr image
|
macro rgbtobgr image
|
||||||
@@ -495,7 +495,7 @@ macro setimg x , y ,arg3
|
|||||||
shl ecx,16
|
shl ecx,16
|
||||||
add cx,[arg3+4]
|
add cx,[arg3+4]
|
||||||
; wordstoreg ecx,[arg3],[arg3+4]
|
; wordstoreg ecx,[arg3],[arg3+4]
|
||||||
wordstoreg edx, x , y ;arg1*65536+arg2
|
words2reg edx, x , y ;arg1*65536+arg2
|
||||||
int 0x40
|
int 0x40
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,7 +504,7 @@ macro setframe x , y ,arg3
|
|||||||
mov eax,7
|
mov eax,7
|
||||||
mov ebx,arg3
|
mov ebx,arg3
|
||||||
add ebx,8
|
add ebx,8
|
||||||
wordstoreg edx, x , y ;arg1*65536+arg2
|
words2reg edx, x , y ;arg1*65536+arg2
|
||||||
add edx,dword [arg3]
|
add edx,dword [arg3]
|
||||||
mov ecx,dword [arg3+4]
|
mov ecx,dword [arg3+4]
|
||||||
int 0x40
|
int 0x40
|
||||||
@@ -697,7 +697,7 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
|
|||||||
sub esi,dword [bmptoimg_data_area_bps]
|
sub esi,dword [bmptoimg_data_area_bps]
|
||||||
sub esi,dword [bmptoimg_data_area_bps]
|
sub esi,dword [bmptoimg_data_area_bps]
|
||||||
cmp esi,dword [bmptoimg_data_area_sop]
|
cmp esi,dword [bmptoimg_data_area_sop]
|
||||||
jb end_bmp
|
jb end_bmp
|
||||||
add edi,eax
|
add edi,eax
|
||||||
add ebp,eax
|
add ebp,eax
|
||||||
jmp nextstring
|
jmp nextstring
|
||||||
@@ -705,7 +705,7 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
|
|||||||
convertno32:
|
convertno32:
|
||||||
mov ebx,bmp_load_area
|
mov ebx,bmp_load_area
|
||||||
add ebx, [bmp_load_area+14]
|
add ebx, [bmp_load_area+14]
|
||||||
add ebx,14 ;start of color table
|
add ebx,14 ;start of color table
|
||||||
push esi
|
push esi
|
||||||
add esi,dword [bmptoimg_data_area_bps]
|
add esi,dword [bmptoimg_data_area_bps]
|
||||||
mov dword [bmptoimg_data_area_eos],esi
|
mov dword [bmptoimg_data_area_eos],esi
|
||||||
@@ -714,9 +714,9 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
|
|||||||
push eax
|
push eax
|
||||||
movzx eax,byte [esi]
|
movzx eax,byte [esi]
|
||||||
cmp word [bmp_load_area+28],4
|
cmp word [bmp_load_area+28],4
|
||||||
je convert4bpp
|
je convert4bpp
|
||||||
cmp word [bmp_load_area+28],1
|
cmp word [bmp_load_area+28],1
|
||||||
je convert1bpp
|
je convert1bpp
|
||||||
call converttable
|
call converttable
|
||||||
|
|
||||||
convert2:
|
convert2:
|
||||||
@@ -750,7 +750,7 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
|
|||||||
mov edx,7
|
mov edx,7
|
||||||
nextbit:
|
nextbit:
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
bt ecx,edx
|
bt ecx,edx
|
||||||
jnc noaddelem
|
jnc noaddelem
|
||||||
inc eax
|
inc eax
|
||||||
noaddelem:
|
noaddelem:
|
||||||
@@ -758,7 +758,7 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
|
|||||||
call converttable
|
call converttable
|
||||||
pop edx
|
pop edx
|
||||||
dec edx
|
dec edx
|
||||||
js convert2
|
js convert2
|
||||||
add edi,3
|
add edi,3
|
||||||
|
|
||||||
add ebp,3
|
add ebp,3
|
||||||
@@ -776,12 +776,12 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
|
|||||||
bmptoimg_data_area_count=bmptoimg_data_area_count+1
|
bmptoimg_data_area_count=bmptoimg_data_area_count+1
|
||||||
if bmptoimg_data_area_count = 1
|
if bmptoimg_data_area_count = 1
|
||||||
; DATA AREA
|
; DATA AREA
|
||||||
bmptoimg_soi dd 0
|
bmptoimg_soi dd 0
|
||||||
bmptoimg_data_area_bps dd 0
|
bmptoimg_data_area_bps dd 0
|
||||||
bmptoimg_data_area_dwps dd 0
|
bmptoimg_data_area_dwps dd 0
|
||||||
bmptoimg_data_area_sop dd 0
|
bmptoimg_data_area_sop dd 0
|
||||||
bmptoimg_data_area_eop dd 0
|
bmptoimg_data_area_eop dd 0
|
||||||
bmptoimg_data_area_eos dd 0
|
bmptoimg_data_area_eos dd 0
|
||||||
end if
|
end if
|
||||||
|
|
||||||
end_bmp:
|
end_bmp:
|
||||||
@@ -806,7 +806,7 @@ local notintable, er, zend, nxt, continue, ex, Gif_skipmap
|
|||||||
local Gif_get_sym, shift, nextbl, noblock, loop1, exx
|
local Gif_get_sym, shift, nextbl, noblock, loop1, exx
|
||||||
local Gif_output, next, loop2
|
local Gif_output, next, loop2
|
||||||
|
|
||||||
_null equ 0x1000 ; 0x1000
|
_null = 0x1000 ; 0x1000
|
||||||
|
|
||||||
; jmp sss
|
; jmp sss
|
||||||
; if defined gif_hash_offset
|
; if defined gif_hash_offset
|
||||||
@@ -816,13 +816,13 @@ _null equ 0x1000 ; 0x1000
|
|||||||
; end if
|
; end if
|
||||||
;sss:
|
;sss:
|
||||||
|
|
||||||
mov esi,gifsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><><EFBFBD> 䠨<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov esi,gifsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><><EFBFBD> 䠨<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov edi,imgsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> ᯨ᮪ <20><><EFBFBD>⨭<EFBFBD><E2A8AD>
|
mov edi,imgsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> ᯨ᮪ <20><><EFBFBD>⨭<EFBFBD><E2A8AD>
|
||||||
|
|
||||||
if defined gif_hash_offset
|
if defined gif_hash_offset
|
||||||
mov eax,gif_hash_offset ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
|
mov eax,gif_hash_offset ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
|
||||||
else
|
else
|
||||||
mov eax,hasharea ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
|
mov eax,hasharea ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
|
||||||
end if
|
end if
|
||||||
|
|
||||||
call ReadGIF
|
call ReadGIF
|
||||||
@@ -845,12 +845,12 @@ ReadGIF:
|
|||||||
mov [img_count],eax
|
mov [img_count],eax
|
||||||
inc eax
|
inc eax
|
||||||
cmp dword[esi],'GIF8'
|
cmp dword[esi],'GIF8'
|
||||||
jne er ; signature
|
jne er ; signature
|
||||||
mov ecx,[esi+0xa]
|
mov ecx,[esi+0xa]
|
||||||
inc eax
|
inc eax
|
||||||
add esi,0xd
|
add esi,0xd
|
||||||
mov edi,esi
|
mov edi,esi
|
||||||
bt ecx,7
|
bt ecx,7
|
||||||
jnc nextblock
|
jnc nextblock
|
||||||
mov [globalColor],esi
|
mov [globalColor],esi
|
||||||
call Gif_skipmap
|
call Gif_skipmap
|
||||||
@@ -891,8 +891,8 @@ noextblock:
|
|||||||
push edi
|
push edi
|
||||||
movzx ecx,word[esi]
|
movzx ecx,word[esi]
|
||||||
inc esi
|
inc esi
|
||||||
bt ecx,7
|
bt ecx,7
|
||||||
jc uselocal
|
jc uselocal
|
||||||
push [globalColor]
|
push [globalColor]
|
||||||
mov edi,esi
|
mov edi,esi
|
||||||
jmp setPal
|
jmp setPal
|
||||||
@@ -909,7 +909,7 @@ setPal:
|
|||||||
mov edi,[table_ptr]
|
mov edi,[table_ptr]
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
cld
|
cld
|
||||||
lodsb ; eax - block_count
|
lodsb ; eax - block_count
|
||||||
add eax,esi
|
add eax,esi
|
||||||
mov [block_ofs],eax
|
mov [block_ofs],eax
|
||||||
mov [bit_count],8
|
mov [bit_count],8
|
||||||
@@ -933,7 +933,7 @@ reinit:
|
|||||||
pop [compsize]
|
pop [compsize]
|
||||||
call Gif_get_sym
|
call Gif_get_sym
|
||||||
cmp eax,[CC]
|
cmp eax,[CC]
|
||||||
je reinit
|
je reinit
|
||||||
call Gif_output
|
call Gif_output
|
||||||
cycle:
|
cycle:
|
||||||
movzx ebx,ax
|
movzx ebx,ax
|
||||||
@@ -941,9 +941,9 @@ cycle:
|
|||||||
cmp eax,edx
|
cmp eax,edx
|
||||||
jae notintable
|
jae notintable
|
||||||
cmp eax,[CC]
|
cmp eax,[CC]
|
||||||
je reinit
|
je reinit
|
||||||
cmp eax,[EOI]
|
cmp eax,[EOI]
|
||||||
je zend
|
je zend
|
||||||
call Gif_output
|
call Gif_output
|
||||||
zadd:
|
zadd:
|
||||||
push eax
|
push eax
|
||||||
@@ -997,7 +997,7 @@ Gif_skipmap:
|
|||||||
; out: edi - pointer to area after colormap
|
; out: edi - pointer to area after colormap
|
||||||
|
|
||||||
and ecx,111b
|
and ecx,111b
|
||||||
inc ecx ; color map size
|
inc ecx ; color map size
|
||||||
mov ebx,1
|
mov ebx,1
|
||||||
shl ebx,cl
|
shl ebx,cl
|
||||||
lea ebx,[ebx*2+ebx]
|
lea ebx,[ebx*2+ebx]
|
||||||
@@ -1015,7 +1015,7 @@ shift:
|
|||||||
jnz loop1
|
jnz loop1
|
||||||
inc esi
|
inc esi
|
||||||
cmp esi,[block_ofs]
|
cmp esi,[block_ofs]
|
||||||
jb noblock
|
jb noblock
|
||||||
push eax
|
push eax
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
lodsb
|
lodsb
|
||||||
@@ -1057,14 +1057,14 @@ loop2:
|
|||||||
add esi,[Palette]
|
add esi,[Palette]
|
||||||
|
|
||||||
if COLOR_ORDER eq MENUETOS
|
if COLOR_ORDER eq MENUETOS
|
||||||
mov esi,[esi]
|
mov esi,[esi]
|
||||||
bswap esi
|
bswap esi
|
||||||
shr esi,8
|
shr esi,8
|
||||||
mov [edi],esi
|
mov [edi],esi
|
||||||
add edi,3
|
add edi,3
|
||||||
else
|
else
|
||||||
movsw
|
movsw
|
||||||
movsb
|
movsb
|
||||||
end if
|
end if
|
||||||
|
|
||||||
loop loop2
|
loop loop2
|
||||||
@@ -1073,7 +1073,7 @@ loop2:
|
|||||||
|
|
||||||
globalColor dd 1
|
globalColor dd 1
|
||||||
img_count dd 1
|
img_count dd 1
|
||||||
cur_info dd 1 ; image table pointer
|
cur_info dd 1 ; image table pointer
|
||||||
img_start dd 1
|
img_start dd 1
|
||||||
codesize dd 1
|
codesize dd 1
|
||||||
compsize dd 1
|
compsize dd 1
|
||||||
@@ -1101,15 +1101,15 @@ local notintable, er, zend, nxt, continue, ex, Gif_skipmap
|
|||||||
local Gif_get_sym, shift, nextbl, noblock, loop1, exx
|
local Gif_get_sym, shift, nextbl, noblock, loop1, exx
|
||||||
local Gif_output, next, loop2
|
local Gif_output, next, loop2
|
||||||
|
|
||||||
_null fix 0x1000 ; 0x1000
|
_null = 0x1000 ; 0x1000
|
||||||
|
|
||||||
mov esi,gifsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><><EFBFBD> 䠨<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
mov esi,gifsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><><EFBFBD> 䠨<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
mov edi,imgsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> ᯨ᮪ <20><><EFBFBD>⨭<EFBFBD><E2A8AD>
|
mov edi,imgsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> ᯨ᮪ <20><><EFBFBD>⨭<EFBFBD><E2A8AD>
|
||||||
|
|
||||||
if defined gif_hash_offset
|
if defined gif_hash_offset
|
||||||
mov eax,gif_hash_offset ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
|
mov eax,gif_hash_offset ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
|
||||||
else
|
else
|
||||||
mov eax,hasharea ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
|
mov eax,hasharea ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
|
||||||
end if
|
end if
|
||||||
|
|
||||||
call ReadGIF
|
call ReadGIF
|
||||||
@@ -1130,12 +1130,12 @@ ReadGIF:
|
|||||||
mov [img_count],eax
|
mov [img_count],eax
|
||||||
inc eax
|
inc eax
|
||||||
cmp dword[esi],'GIF8'
|
cmp dword[esi],'GIF8'
|
||||||
jne er ; signature
|
jne er ; signature
|
||||||
mov ecx,[esi+0xa]
|
mov ecx,[esi+0xa]
|
||||||
inc eax
|
inc eax
|
||||||
add esi,0xd
|
add esi,0xd
|
||||||
mov edi,esi
|
mov edi,esi
|
||||||
bt ecx,7
|
bt ecx,7
|
||||||
jnc nextblock
|
jnc nextblock
|
||||||
mov [globalColor],esi
|
mov [globalColor],esi
|
||||||
call Gif_skipmap
|
call Gif_skipmap
|
||||||
@@ -1187,8 +1187,8 @@ noextblock:
|
|||||||
push edi
|
push edi
|
||||||
movzx ecx,word[esi]
|
movzx ecx,word[esi]
|
||||||
inc esi
|
inc esi
|
||||||
bt ecx,7
|
bt ecx,7
|
||||||
jc uselocal
|
jc uselocal
|
||||||
push [globalColor]
|
push [globalColor]
|
||||||
mov edi,esi
|
mov edi,esi
|
||||||
jmp setPal
|
jmp setPal
|
||||||
@@ -1205,7 +1205,7 @@ setPal:
|
|||||||
mov edi,[table_ptr]
|
mov edi,[table_ptr]
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
cld
|
cld
|
||||||
lodsb ; eax - block_count
|
lodsb ; eax - block_count
|
||||||
add eax,esi
|
add eax,esi
|
||||||
mov [block_ofs],eax
|
mov [block_ofs],eax
|
||||||
mov [bit_count],8
|
mov [bit_count],8
|
||||||
@@ -1229,7 +1229,7 @@ reinit:
|
|||||||
pop [compsize]
|
pop [compsize]
|
||||||
call Gif_get_sym
|
call Gif_get_sym
|
||||||
cmp eax,[CC]
|
cmp eax,[CC]
|
||||||
je reinit
|
je reinit
|
||||||
call Gif_output
|
call Gif_output
|
||||||
cycle:
|
cycle:
|
||||||
movzx ebx,ax
|
movzx ebx,ax
|
||||||
@@ -1237,9 +1237,9 @@ cycle:
|
|||||||
cmp eax,edx
|
cmp eax,edx
|
||||||
jae notintable
|
jae notintable
|
||||||
cmp eax,[CC]
|
cmp eax,[CC]
|
||||||
je reinit
|
je reinit
|
||||||
cmp eax,[EOI]
|
cmp eax,[EOI]
|
||||||
je zend
|
je zend
|
||||||
call Gif_output
|
call Gif_output
|
||||||
zadd:
|
zadd:
|
||||||
push eax
|
push eax
|
||||||
@@ -1291,9 +1291,8 @@ ex:
|
|||||||
Gif_skipmap:
|
Gif_skipmap:
|
||||||
; in: ecx - image descriptor, esi - pointer to colormap
|
; in: ecx - image descriptor, esi - pointer to colormap
|
||||||
; out: edi - pointer to area after colormap
|
; out: edi - pointer to area after colormap
|
||||||
|
|
||||||
and ecx,111b
|
and ecx,111b
|
||||||
inc ecx ; color map size
|
inc ecx ; color map size
|
||||||
mov ebx,1
|
mov ebx,1
|
||||||
shl ebx,cl
|
shl ebx,cl
|
||||||
lea ebx,[ebx*2+ebx]
|
lea ebx,[ebx*2+ebx]
|
||||||
@@ -1311,7 +1310,7 @@ shift:
|
|||||||
jnz loop1
|
jnz loop1
|
||||||
inc esi
|
inc esi
|
||||||
cmp esi,[block_ofs]
|
cmp esi,[block_ofs]
|
||||||
jb noblock
|
jb noblock
|
||||||
push eax
|
push eax
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
lodsb
|
lodsb
|
||||||
@@ -1353,14 +1352,14 @@ loop2:
|
|||||||
add esi,[Palette]
|
add esi,[Palette]
|
||||||
|
|
||||||
if COLOR_ORDER eq MENUETOS
|
if COLOR_ORDER eq MENUETOS
|
||||||
mov esi,[esi]
|
mov esi,[esi]
|
||||||
bswap esi
|
bswap esi
|
||||||
shr esi,8
|
shr esi,8
|
||||||
mov [edi],esi
|
mov [edi],esi
|
||||||
add edi,3
|
add edi,3
|
||||||
else
|
else
|
||||||
movsw
|
movsw
|
||||||
movsb
|
movsb
|
||||||
end if
|
end if
|
||||||
|
|
||||||
loop loop2
|
loop loop2
|
||||||
@@ -1369,7 +1368,7 @@ loop2:
|
|||||||
|
|
||||||
globalColor dd 1
|
globalColor dd 1
|
||||||
img_count dd 1
|
img_count dd 1
|
||||||
cur_info dd 1 ; image table pointer
|
cur_info dd 1 ; image table pointer
|
||||||
img_start dd 1
|
img_start dd 1
|
||||||
codesize dd 1
|
codesize dd 1
|
||||||
compsize dd 1
|
compsize dd 1
|
||||||
|
49
programs/fs/sysxtree/trunk/ascgml.inc
Normal file
49
programs/fs/sysxtree/trunk/ascgml.inc
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
lang equ ru
|
||||||
|
|
||||||
|
;
|
||||||
|
; Assembler
|
||||||
|
; SMALL
|
||||||
|
; CODE
|
||||||
|
; GaMe
|
||||||
|
; Libary
|
||||||
|
;
|
||||||
|
; Ver 0.03 By Pavlushin Evgeni (RUSSIA)
|
||||||
|
; www.waptap@mail.ru
|
||||||
|
|
||||||
|
;InfoList
|
||||||
|
;0.01 correct
|
||||||
|
;0.02 control ~14.05.2004
|
||||||
|
;0.03 all macros optimized by halyavin, add at ~07.06.2004
|
||||||
|
|
||||||
|
|
||||||
|
; corectiryemoe,corectnoe,step
|
||||||
|
macro correct arg1,arg2,arg3
|
||||||
|
{
|
||||||
|
local plus,minus,equal
|
||||||
|
mov eax,arg2
|
||||||
|
cmp arg1,eax
|
||||||
|
je equal
|
||||||
|
mov eax,arg3
|
||||||
|
ja minus
|
||||||
|
plus:
|
||||||
|
add arg1,eax
|
||||||
|
jmp equal
|
||||||
|
minus:
|
||||||
|
sub arg1,eax
|
||||||
|
equal:
|
||||||
|
}
|
||||||
|
|
||||||
|
macro control min,max,arg
|
||||||
|
{
|
||||||
|
local gr,low,norm
|
||||||
|
mov eax,max
|
||||||
|
cmp arg,eax
|
||||||
|
jg gr
|
||||||
|
mov eax,min
|
||||||
|
cmp arg,eax
|
||||||
|
jnl norm
|
||||||
|
gr:
|
||||||
|
low:
|
||||||
|
mov arg,eax
|
||||||
|
norm:
|
||||||
|
}
|
@@ -27,11 +27,13 @@ lang equ ru ; ru en fr ge fi
|
|||||||
;0.12 open/save dialog ~13.09.2004
|
;0.12 open/save dialog ~13.09.2004
|
||||||
;0.13 dialogs bugs deleted
|
;0.13 dialogs bugs deleted
|
||||||
;0.14 drawlbut ~03.10.2004
|
;0.14 drawlbut ~03.10.2004
|
||||||
|
;0.15 extendet label!
|
||||||
|
|
||||||
; LOADFILE
|
; LOADFILE
|
||||||
; (SYNTAX) LOADFILE 'full_path_to_file',file_load_area,file_temp_area
|
; (SYNTAX) LOADFILE 'full_path_to_file',file_load_area,file_temp_area
|
||||||
; (SAMPLE) LOADFILE '/rd/1/clock.bmp',load_area,temp_area
|
; (SAMPLE) LOADFILE '/rd/1/clock.bmp',load_area,temp_area
|
||||||
|
|
||||||
|
|
||||||
macro loadfile file_name,file_load_area,file_temp_area
|
macro loadfile file_name,file_load_area,file_temp_area
|
||||||
{
|
{
|
||||||
local open,fileinfo,string
|
local open,fileinfo,string
|
||||||
@@ -59,24 +61,74 @@ open:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
macro wordstoreg reg,hiword,loword
|
;macro wordstoreg reg,hiword,loword
|
||||||
|
;{
|
||||||
|
;if hiword eqtype 0 & loword eqtype 0
|
||||||
|
; mov reg,dword hiword*65536+loword
|
||||||
|
;else if hiword eqtype 12 & loword eqtype eax
|
||||||
|
; mov reg,dword hiword*65536
|
||||||
|
; add reg,dword loword
|
||||||
|
;else if hiword eqtype 12 & loword eqtype [123]
|
||||||
|
; mov reg,dword hiword*65536
|
||||||
|
; add reg,dword loword
|
||||||
|
;else
|
||||||
|
; mov reg,dword hiword
|
||||||
|
; shl reg,16
|
||||||
|
; add reg,dword loword
|
||||||
|
;end if
|
||||||
|
;}
|
||||||
|
|
||||||
|
macro dword2reg reg,doubleword
|
||||||
{
|
{
|
||||||
if hiword eqtype 0 & loword eqtype 0
|
if doubleword eq
|
||||||
mov reg,(hiword)*65536+(loword)
|
; not changes
|
||||||
else if hiword eqtype 12 & loword eqtype eax
|
|
||||||
mov reg,(hiword)*65536
|
|
||||||
add reg,loword
|
|
||||||
else if hiword eqtype 0 & loword eqtype [123]
|
|
||||||
mov reg,(hiword)*65536
|
|
||||||
add reg,loword
|
|
||||||
else if (hiword eq ) & (loword eq )
|
|
||||||
else
|
else
|
||||||
mov reg,hiword
|
mov reg,dword doubleword
|
||||||
shl reg,16
|
|
||||||
add reg,loword
|
|
||||||
end if
|
end if
|
||||||
}
|
}
|
||||||
|
|
||||||
|
macro words2reg reg,hiword,lowword
|
||||||
|
{
|
||||||
|
if hiword eq
|
||||||
|
if lowword eq
|
||||||
|
; not changes
|
||||||
|
else
|
||||||
|
if lowword eqtype 12
|
||||||
|
and reg,dword 0xffff0000
|
||||||
|
add reg,dword lowword
|
||||||
|
else
|
||||||
|
and reg,dword 0xffff0000
|
||||||
|
add reg,dword lowword
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
else
|
||||||
|
if lowword eq
|
||||||
|
if hiword eqtype 12
|
||||||
|
and reg,dword 0x0000ffff
|
||||||
|
add reg,dword hiword*65536
|
||||||
|
else
|
||||||
|
shl reg,16
|
||||||
|
add reg,dword hiword
|
||||||
|
ror reg,16
|
||||||
|
end if
|
||||||
|
else
|
||||||
|
if lowword eqtype 12 & hiword eqtype 12
|
||||||
|
if lowword eq 0 & hiword eq 0
|
||||||
|
xor reg,reg
|
||||||
|
else
|
||||||
|
mov reg,dword hiword*65536+lowword
|
||||||
|
end if
|
||||||
|
else
|
||||||
|
mov reg,dword hiword
|
||||||
|
shl reg,16
|
||||||
|
add reg,dword lowword
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; DRAW BUTTON with label
|
; DRAW BUTTON with label
|
||||||
|
|
||||||
@@ -86,8 +138,8 @@ local asd,lab
|
|||||||
jmp asd
|
jmp asd
|
||||||
lab db text ;arg label
|
lab db text ;arg label
|
||||||
asd:
|
asd:
|
||||||
wordstoreg ebx,x,xs
|
words2reg ebx,x,xs
|
||||||
wordstoreg ecx,y,ys
|
words2reg ecx,y,ys
|
||||||
mov edx,id
|
mov edx,id
|
||||||
mov esi,bcolor
|
mov esi,bcolor
|
||||||
mov eax,8
|
mov eax,8
|
||||||
@@ -328,7 +380,7 @@ run_fileinfo:
|
|||||||
db '/RD/1/SYSXTREE',0
|
db '/RD/1/SYSXTREE',0
|
||||||
|
|
||||||
procinfo:
|
procinfo:
|
||||||
times 256 db 0
|
times 1024 db 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -390,7 +442,7 @@ new_d:
|
|||||||
mov eax,60
|
mov eax,60
|
||||||
mov ebx,1 ; define IPC
|
mov ebx,1 ; define IPC
|
||||||
mov ecx,path ; offset of area
|
mov ecx,path ; offset of area
|
||||||
mov edx,120 ; size 150 bytes
|
mov edx,150 ; size 150 bytes
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
; change wanted events list 7-bit IPC event
|
; change wanted events list 7-bit IPC event
|
||||||
@@ -458,6 +510,7 @@ mred:
|
|||||||
call redproc
|
call redproc
|
||||||
jmp getmesloop
|
jmp getmesloop
|
||||||
mkey:
|
mkey:
|
||||||
|
mov eax,2
|
||||||
int 0x40 ; read (eax=2)
|
int 0x40 ; read (eax=2)
|
||||||
jmp getmesloop
|
jmp getmesloop
|
||||||
mbutton:
|
mbutton:
|
||||||
@@ -526,8 +579,8 @@ dlg_pid_get dd 0
|
|||||||
DLGPID dd 0
|
DLGPID dd 0
|
||||||
|
|
||||||
param:
|
param:
|
||||||
rb 4 ; My dec PID
|
dd 0 ; My dec PID
|
||||||
rb 6 ; Type of dialog
|
dd 0,0 ; Type of dialog
|
||||||
|
|
||||||
run_fileinfo:
|
run_fileinfo:
|
||||||
dd 16
|
dd 16
|
||||||
@@ -535,11 +588,11 @@ run_fileinfo:
|
|||||||
dd param
|
dd param
|
||||||
dd 0
|
dd 0
|
||||||
dd procinfo
|
dd procinfo
|
||||||
run_filepath:
|
;run_filepath:
|
||||||
db '/RD/1/SYSXTREE',0
|
db '/RD/1/SYSXTREE',0
|
||||||
|
|
||||||
procinfo:
|
procinfo:
|
||||||
times 256 db 0
|
times 1024 db 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -635,10 +688,15 @@ macro puttxt x,y,offs,size,color
|
|||||||
; mov ebx,x
|
; mov ebx,x
|
||||||
; shl ebx,16
|
; shl ebx,16
|
||||||
; add ebx,y
|
; add ebx,y
|
||||||
wordstoreg ebx,x,y
|
words2reg ebx,x,y
|
||||||
mov ecx,color
|
|
||||||
mov edx,offs
|
dword2reg ecx,color
|
||||||
mov esi,size
|
dword2reg edx,offs
|
||||||
|
dword2reg esi,size
|
||||||
|
|
||||||
|
; mov ecx,color
|
||||||
|
; mov edx,offs
|
||||||
|
; mov esi,size
|
||||||
mov eax,4
|
mov eax,4
|
||||||
int 0x40
|
int 0x40
|
||||||
}
|
}
|
||||||
@@ -649,7 +707,7 @@ macro outcount data, x, y, color, numtype
|
|||||||
mov ebx,numtype
|
mov ebx,numtype
|
||||||
mov bl,0
|
mov bl,0
|
||||||
; mov edx,x*65536+y
|
; mov edx,x*65536+y
|
||||||
wordstoreg edx,x,y
|
words2reg edx,x,y
|
||||||
mov esi,color
|
mov esi,color
|
||||||
mov eax,47
|
mov eax,47
|
||||||
int 0x40
|
int 0x40
|
||||||
@@ -728,8 +786,8 @@ macro window arg1,arg2,arg3,arg4,arg5
|
|||||||
{
|
{
|
||||||
; mov ebx,arg1*65536+arg3
|
; mov ebx,arg1*65536+arg3
|
||||||
; mov ecx,arg2*65536+arg4
|
; mov ecx,arg2*65536+arg4
|
||||||
wordstoreg ebx,arg1,arg3
|
words2reg ebx,arg1,arg3
|
||||||
wordstoreg ecx,arg2,arg4
|
words2reg ecx,arg2,arg4
|
||||||
mov edx,arg5
|
mov edx,arg5
|
||||||
mov eax,0
|
mov eax,0
|
||||||
int 0x40
|
int 0x40
|
||||||
@@ -769,7 +827,7 @@ macro endwd
|
|||||||
; (SYNTAX) LABEL Xstart,Ystart,'Text',Color
|
; (SYNTAX) LABEL Xstart,Ystart,'Text',Color
|
||||||
; (SAMPLE) LABEL 10,12,'Hello World!',cl_Green+font_Big
|
; (SAMPLE) LABEL 10,12,'Hello World!',cl_Green+font_Big
|
||||||
|
|
||||||
macro label arg1,arg2,arg3,arg4
|
macro glabel arg1,arg2,arg3,arg4
|
||||||
{
|
{
|
||||||
local asd,lab
|
local asd,lab
|
||||||
jmp asd
|
jmp asd
|
||||||
@@ -778,10 +836,11 @@ asd:
|
|||||||
; mov ebx,arg1 ;arg1=y arg2=x
|
; mov ebx,arg1 ;arg1=y arg2=x
|
||||||
; shl ebx,16
|
; shl ebx,16
|
||||||
; add ebx,arg2
|
; add ebx,arg2
|
||||||
wordstoreg ebx,arg1,arg2
|
|
||||||
if ~(arg4 eq )
|
words2reg ebx,arg1,arg2
|
||||||
mov ecx,arg4 ;arg4 color
|
|
||||||
end if
|
dword2reg ecx,arg4
|
||||||
|
|
||||||
mov edx,lab
|
mov edx,lab
|
||||||
mov esi,asd-lab ;calc size
|
mov esi,asd-lab ;calc size
|
||||||
mov eax,4
|
mov eax,4
|
||||||
|
93
programs/fs/sysxtree/trunk/ascml.inc
Normal file
93
programs/fs/sysxtree/trunk/ascml.inc
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
lang equ ru
|
||||||
|
|
||||||
|
;
|
||||||
|
; Assembler
|
||||||
|
; SMALL
|
||||||
|
; CODE
|
||||||
|
; Massive operation
|
||||||
|
; Libary
|
||||||
|
;
|
||||||
|
; Ver 0.1 By Pavlushin Evgeni (RUSSIA)
|
||||||
|
; www.waptap@mail.ru
|
||||||
|
|
||||||
|
;InfoList
|
||||||
|
;0.01 readmas,compmas,findmas
|
||||||
|
|
||||||
|
macro readmas masoff,obroff
|
||||||
|
{
|
||||||
|
local loo
|
||||||
|
mov edi,masoff
|
||||||
|
add edi,8
|
||||||
|
mov ebp,[masoff] ;elements
|
||||||
|
mov edx,[masoff+4] ;elemsize
|
||||||
|
mov eax,0 ;count
|
||||||
|
loo:
|
||||||
|
pushad
|
||||||
|
call obroff
|
||||||
|
popad
|
||||||
|
add edi,edx
|
||||||
|
inc eax
|
||||||
|
cmp eax,ebp
|
||||||
|
jne loo
|
||||||
|
}
|
||||||
|
|
||||||
|
macro compmas masoff1,masoff2,obroff
|
||||||
|
{
|
||||||
|
local loo,loo2
|
||||||
|
mov esi,masoff2
|
||||||
|
add esi,8
|
||||||
|
mov ecx,[masoff2]
|
||||||
|
mov ebx,[masoff2+4]
|
||||||
|
mov eax,0
|
||||||
|
|
||||||
|
loo2:
|
||||||
|
push eax
|
||||||
|
|
||||||
|
mov edi,masoff1
|
||||||
|
add edi,8
|
||||||
|
mov ebp,[masoff1] ;elements1
|
||||||
|
mov edx,[masoff1+4] ;elemsize1
|
||||||
|
mov eax,0 ;count
|
||||||
|
loo:
|
||||||
|
pushad
|
||||||
|
call obroff
|
||||||
|
popad
|
||||||
|
add edi,edx
|
||||||
|
inc eax
|
||||||
|
cmp eax,ebp
|
||||||
|
jne loo
|
||||||
|
|
||||||
|
add esi,ebx
|
||||||
|
pop eax
|
||||||
|
inc eax
|
||||||
|
cmp eax,ecx
|
||||||
|
jne loo2
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
macro findmas masoff,obroff
|
||||||
|
{
|
||||||
|
local loo,looend,lend
|
||||||
|
mov edi,masoff
|
||||||
|
add edi,8
|
||||||
|
mov ebp,[masoff] ;elements
|
||||||
|
mov edx,[masoff+4] ;elemsize
|
||||||
|
mov eax,0 ;count
|
||||||
|
loo:
|
||||||
|
pushad
|
||||||
|
mov eax,0
|
||||||
|
call obroff
|
||||||
|
cmp eax,1
|
||||||
|
je looend
|
||||||
|
popad
|
||||||
|
add edi,edx
|
||||||
|
inc eax
|
||||||
|
cmp eax,ebp
|
||||||
|
jne loo
|
||||||
|
stc
|
||||||
|
jmp lend
|
||||||
|
looend:
|
||||||
|
popad
|
||||||
|
clc
|
||||||
|
lend:
|
||||||
|
}
|
@@ -1,3 +1,15 @@
|
|||||||
|
; language for programs
|
||||||
|
lang fix en ; ru en fr ge fi
|
||||||
|
|
||||||
|
@^ fix macro comment {
|
||||||
|
^@ fix }
|
||||||
|
|
||||||
|
|
||||||
|
macro m2m dest,src {
|
||||||
|
push src
|
||||||
|
pop dest
|
||||||
|
}
|
||||||
|
|
||||||
; new application structure
|
; new application structure
|
||||||
macro meos_app_start
|
macro meos_app_start
|
||||||
{
|
{
|
||||||
@@ -74,36 +86,73 @@ struc mstr [sstring]
|
|||||||
|
|
||||||
|
|
||||||
; strings
|
; strings
|
||||||
macro sz name,[data] { ; from MFAR [mike.dld]
|
macro sz name,[data] { ; from MFAR [mike.dld]
|
||||||
common
|
common
|
||||||
if used name
|
if used name
|
||||||
label name
|
name db data
|
||||||
end if
|
.size = $-name
|
||||||
forward
|
end if
|
||||||
if used name
|
|
||||||
db data
|
|
||||||
end if
|
|
||||||
common
|
|
||||||
if used name
|
|
||||||
.size = $-name
|
|
||||||
end if
|
|
||||||
}
|
}
|
||||||
|
|
||||||
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
|
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
|
||||||
common
|
common
|
||||||
if used name
|
if used name
|
||||||
label name
|
label name
|
||||||
end if
|
forward
|
||||||
forward
|
if lang eq lng
|
||||||
if (used name)&(lang eq lng)
|
db data
|
||||||
db data
|
end if
|
||||||
end if
|
common
|
||||||
common
|
.size = $-name
|
||||||
if used name
|
end if
|
||||||
.size = $-name
|
|
||||||
end if
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
macro szc name,elsz,[data] { ; from MFAR [mike.dld]
|
||||||
|
common
|
||||||
|
local s,m
|
||||||
|
m = 0
|
||||||
|
if used name
|
||||||
|
label name
|
||||||
|
virtual at 0
|
||||||
|
db data
|
||||||
|
s = $
|
||||||
|
end virtual
|
||||||
|
d#elsz s
|
||||||
|
if m < s
|
||||||
|
m = s
|
||||||
|
end if
|
||||||
|
db data
|
||||||
|
.size = $-name
|
||||||
|
.maxl = m
|
||||||
|
end if
|
||||||
|
}
|
||||||
|
|
||||||
|
macro lszc name,elsz,[lng,data] { ; from MFAR [mike.dld]
|
||||||
|
common
|
||||||
|
local s,m,c
|
||||||
|
m = 0
|
||||||
|
c = 0
|
||||||
|
if used name
|
||||||
|
label name
|
||||||
|
forward
|
||||||
|
if lang eq lng
|
||||||
|
virtual at 0
|
||||||
|
db data
|
||||||
|
s = $
|
||||||
|
end virtual
|
||||||
|
d#elsz s
|
||||||
|
if m < s
|
||||||
|
m = s
|
||||||
|
end if
|
||||||
|
db data
|
||||||
|
c = c+1
|
||||||
|
end if
|
||||||
|
common
|
||||||
|
.size = $-name
|
||||||
|
.maxl = m
|
||||||
|
.count = c
|
||||||
|
end if
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
; easy system call macro
|
; easy system call macro
|
||||||
@@ -123,8 +172,16 @@ macro mpack dest, hsrc, lsrc
|
|||||||
end if
|
end if
|
||||||
}
|
}
|
||||||
|
|
||||||
macro __mov reg,a { ; mike.dld
|
;macro __mov reg,a { ; mike.dld
|
||||||
if ~a eq
|
; if ~a eq
|
||||||
|
; mov reg,a
|
||||||
|
; end if
|
||||||
|
;}
|
||||||
|
|
||||||
|
macro __mov reg,a,b { ; mike.dld
|
||||||
|
if (~a eq)&(~b eq)
|
||||||
|
mpack reg,a,b
|
||||||
|
else if (~a eq)&(b eq)
|
||||||
mov reg,a
|
mov reg,a
|
||||||
end if
|
end if
|
||||||
}
|
}
|
||||||
@@ -140,11 +197,71 @@ macro mcall a,b,c,d,e,f { ; mike.dld
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
; -------------------------
|
||||||
|
macro header a,[b] {
|
||||||
|
common
|
||||||
|
use32
|
||||||
|
org 0
|
||||||
|
db 'MENUET',a
|
||||||
|
forward
|
||||||
|
if b eq
|
||||||
|
dd 0
|
||||||
|
else
|
||||||
|
dd b
|
||||||
|
end if }
|
||||||
|
macro section name { align 16
|
||||||
|
label name }
|
||||||
|
macro func name {
|
||||||
|
if ~used name
|
||||||
|
display 'FUNC NOT USED: ',`name,13,10
|
||||||
|
else
|
||||||
|
align 4
|
||||||
|
name:
|
||||||
|
;pushad
|
||||||
|
;pushfd
|
||||||
|
;dps `name
|
||||||
|
;newline
|
||||||
|
;mcall 5,1
|
||||||
|
;popfd
|
||||||
|
;popad
|
||||||
|
}
|
||||||
|
macro endf { end if }
|
||||||
|
|
||||||
; language for programs
|
macro diff16 title,l1,l2
|
||||||
lang fix ru ; ru en fr ge fi
|
{
|
||||||
|
local s,d
|
||||||
|
s = l2-l1
|
||||||
|
display title,': 0x'
|
||||||
|
repeat 8
|
||||||
|
d = '0' + s shr ((8-%) shl 2) and $0F
|
||||||
|
if d > '9'
|
||||||
|
d = d + 'A'-'9'-1
|
||||||
|
end if
|
||||||
|
display d
|
||||||
|
end repeat
|
||||||
|
display 13,10
|
||||||
|
}
|
||||||
|
|
||||||
|
macro diff10 title,l1,l2
|
||||||
|
{
|
||||||
|
local s,d,z,m
|
||||||
|
s = l2-l1
|
||||||
|
z = 0
|
||||||
|
m = 1000000000
|
||||||
|
display title,': '
|
||||||
|
repeat 10
|
||||||
|
d = '0' + s / m
|
||||||
|
s = s - (s/m)*m
|
||||||
|
m = m / 10
|
||||||
|
if d <> '0'
|
||||||
|
z = 1
|
||||||
|
end if
|
||||||
|
if z <> 0
|
||||||
|
display d
|
||||||
|
end if
|
||||||
|
end repeat
|
||||||
|
display 13,10
|
||||||
|
}
|
||||||
|
|
||||||
; optimize the code for size
|
; optimize the code for size
|
||||||
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
||||||
@@ -153,9 +270,9 @@ macro add arg1,arg2
|
|||||||
{
|
{
|
||||||
if (arg2 eqtype 0)
|
if (arg2 eqtype 0)
|
||||||
if (arg2) = 1
|
if (arg2) = 1
|
||||||
inc arg1
|
inc arg1
|
||||||
else
|
else
|
||||||
add arg1,arg2
|
add arg1,arg2
|
||||||
end if
|
end if
|
||||||
else
|
else
|
||||||
add arg1,arg2
|
add arg1,arg2
|
||||||
@@ -166,9 +283,9 @@ macro sub arg1,arg2
|
|||||||
{
|
{
|
||||||
if (arg2 eqtype 0)
|
if (arg2 eqtype 0)
|
||||||
if (arg2) = 1
|
if (arg2) = 1
|
||||||
dec arg1
|
dec arg1
|
||||||
else
|
else
|
||||||
sub arg1,arg2
|
sub arg1,arg2
|
||||||
end if
|
end if
|
||||||
else
|
else
|
||||||
sub arg1,arg2
|
sub arg1,arg2
|
||||||
@@ -179,17 +296,17 @@ macro mov arg1,arg2
|
|||||||
{
|
{
|
||||||
if (arg1 in __regs) & (arg2 eqtype 0)
|
if (arg1 in __regs) & (arg2 eqtype 0)
|
||||||
if (arg2) = 0
|
if (arg2) = 0
|
||||||
xor arg1,arg1
|
xor arg1,arg1
|
||||||
else if (arg2) = 1
|
else if (arg2) = 1
|
||||||
xor arg1,arg1
|
xor arg1,arg1
|
||||||
inc arg1
|
inc arg1
|
||||||
else if (arg2) = -1
|
else if (arg2) = -1
|
||||||
or arg1,-1
|
or arg1,-1
|
||||||
else if (arg2) > -128 & (arg2) < 128
|
else if (arg2) > -128 & (arg2) < 128
|
||||||
push arg2
|
push arg2
|
||||||
pop arg1
|
pop arg1
|
||||||
else
|
else
|
||||||
mov arg1,arg2
|
mov arg1,arg2
|
||||||
end if
|
end if
|
||||||
else
|
else
|
||||||
mov arg1,arg2
|
mov arg1,arg2
|
||||||
@@ -197,48 +314,230 @@ macro mov arg1,arg2
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
macro RGB [a] {
|
||||||
|
common
|
||||||
|
match (r=,g=,b),a \{
|
||||||
|
\dd ((r) shl 16) or ((g) shl 8) or (b)
|
||||||
|
\}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struc POINT _t,_dx,_dy {
|
||||||
|
.x _t _dx
|
||||||
|
.y _t _dy
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
; Macroinstructions for defining data structures
|
||||||
|
|
||||||
macro struct name
|
macro struct name
|
||||||
{
|
{ fields@struct equ name
|
||||||
virtual at 0
|
match child parent, name \{ fields@struct equ child,fields@\#parent \}
|
||||||
name name
|
sub@struct equ
|
||||||
sizeof.#name = $ - name
|
struc db [val] \{ \common fields@struct equ fields@struct,.,db,<val> \}
|
||||||
end virtual
|
struc dw [val] \{ \common fields@struct equ fields@struct,.,dw,<val> \}
|
||||||
}
|
struc du [val] \{ \common fields@struct equ fields@struct,.,du,<val> \}
|
||||||
|
struc dd [val] \{ \common fields@struct equ fields@struct,.,dd,<val> \}
|
||||||
|
struc dp [val] \{ \common fields@struct equ fields@struct,.,dp,<val> \}
|
||||||
|
struc dq [val] \{ \common fields@struct equ fields@struct,.,dq,<val> \}
|
||||||
|
struc dt [val] \{ \common fields@struct equ fields@struct,.,dt,<val> \}
|
||||||
|
struc rb count \{ fields@struct equ fields@struct,.,db,count dup (?) \}
|
||||||
|
struc rw count \{ fields@struct equ fields@struct,.,dw,count dup (?) \}
|
||||||
|
struc rd count \{ fields@struct equ fields@struct,.,dd,count dup (?) \}
|
||||||
|
struc rp count \{ fields@struct equ fields@struct,.,dp,count dup (?) \}
|
||||||
|
struc rq count \{ fields@struct equ fields@struct,.,dq,count dup (?) \}
|
||||||
|
struc rt count \{ fields@struct equ fields@struct,.,dt,count dup (?) \}
|
||||||
|
macro db [val] \{ \common \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,db,<val> \}
|
||||||
|
macro dw [val] \{ \common \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,dw,<val> \}
|
||||||
|
macro du [val] \{ \common \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,du,<val> \}
|
||||||
|
macro dd [val] \{ \common \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,dd,<val> \}
|
||||||
|
macro dp [val] \{ \common \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,dp,<val> \}
|
||||||
|
macro dq [val] \{ \common \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,dq,<val> \}
|
||||||
|
macro dt [val] \{ \common \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,dt,<val> \}
|
||||||
|
macro rb count \{ \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,db,count dup (?) \}
|
||||||
|
macro rw count \{ \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,dw,count dup (?) \}
|
||||||
|
macro rd count \{ \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,dd,count dup (?) \}
|
||||||
|
macro rp count \{ \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,dp,count dup (?) \}
|
||||||
|
macro rq count \{ \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,dq,count dup (?) \}
|
||||||
|
macro rt count \{ \local anonymous
|
||||||
|
fields@struct equ fields@struct,anonymous,dt,count dup (?) \}
|
||||||
|
macro union \{ fields@struct equ fields@struct,,union,<
|
||||||
|
sub@struct equ union \}
|
||||||
|
macro struct \{ fields@struct equ fields@struct,,substruct,<
|
||||||
|
sub@struct equ substruct \}
|
||||||
|
virtual at 0 }
|
||||||
|
|
||||||
|
macro ends
|
||||||
|
{ match , sub@struct \{ restruc db,dw,du,dd,dp,dq,dt
|
||||||
|
restruc rb,rw,rd,rp,rq,rt
|
||||||
|
purge db,dw,du,dd,dp,dq,dt
|
||||||
|
purge rb,rw,rd,rp,rq,rt
|
||||||
|
purge union,struct
|
||||||
|
match name=,fields,fields@struct \\{ fields@struct equ
|
||||||
|
make@struct name,fields
|
||||||
|
fields@\\#name equ fields \\}
|
||||||
|
end virtual \}
|
||||||
|
match any, sub@struct \{ fields@struct equ fields@struct> \}
|
||||||
|
restore sub@struct }
|
||||||
|
|
||||||
|
macro make@struct name,[field,type,def]
|
||||||
|
{ common
|
||||||
|
if $
|
||||||
|
display 'Error: definition of ',`name,' contains illegal instructions.',0Dh,0Ah
|
||||||
|
err
|
||||||
|
end if
|
||||||
|
local define
|
||||||
|
define equ name
|
||||||
|
forward
|
||||||
|
local sub
|
||||||
|
match , field \{ make@substruct type,name,sub def
|
||||||
|
define equ define,.,sub, \}
|
||||||
|
match any, field \{ define equ define,.#field,type,<def> \}
|
||||||
|
common
|
||||||
|
match fields, define \{ define@struct fields \} }
|
||||||
|
|
||||||
|
macro define@struct name,[field,type,def]
|
||||||
|
{ common
|
||||||
|
local list
|
||||||
|
list equ
|
||||||
|
forward
|
||||||
|
if ~ field eq .
|
||||||
|
name#field type def
|
||||||
|
sizeof.#name#field = $ - name#field
|
||||||
|
else
|
||||||
|
rb sizeof.#type
|
||||||
|
end if
|
||||||
|
local value
|
||||||
|
match any, list \{ list equ list, \}
|
||||||
|
list equ list <value>
|
||||||
|
common
|
||||||
|
sizeof.#name = $
|
||||||
|
restruc name
|
||||||
|
match values, list \{
|
||||||
|
struc name value \\{
|
||||||
|
match any, fields@struct \\\{ fields@struct equ fields@struct,.,name,<values> \\\}
|
||||||
|
match , fields@struct \\\{ label .
|
||||||
|
forward
|
||||||
|
match , value \\\\{ field type def \\\\}
|
||||||
|
match any, value \\\\{ field type value
|
||||||
|
if ~ field eq .
|
||||||
|
rb sizeof.#name#field - ($-field)
|
||||||
|
end if \\\\}
|
||||||
|
common \\\} \\} \} }
|
||||||
|
|
||||||
|
macro enable@substruct
|
||||||
|
{ macro make@substruct substruct,parent,name,[field,type,def]
|
||||||
|
\{ \common
|
||||||
|
\local define
|
||||||
|
define equ parent,name
|
||||||
|
\forward
|
||||||
|
\local sub
|
||||||
|
match , field \\{ match any, type \\\{ enable@substruct
|
||||||
|
make@substruct type,name,sub def
|
||||||
|
purge make@substruct
|
||||||
|
define equ define,.,sub, \\\} \\}
|
||||||
|
match any, field \\{ define equ define,.\#field,type,<def> \\}
|
||||||
|
\common
|
||||||
|
match fields, define \\{ define@\#substruct fields \\} \} }
|
||||||
|
|
||||||
|
enable@substruct
|
||||||
|
|
||||||
|
macro define@union parent,name,[field,type,def]
|
||||||
|
{ common
|
||||||
|
virtual at 0
|
||||||
|
forward
|
||||||
|
if ~ field eq .
|
||||||
|
virtual at 0
|
||||||
|
parent#field type def
|
||||||
|
sizeof.#parent#field = $ - parent#field
|
||||||
|
end virtual
|
||||||
|
if sizeof.#parent#field > $
|
||||||
|
rb sizeof.#parent#field - $
|
||||||
|
end if
|
||||||
|
else if sizeof.#type > $
|
||||||
|
rb sizeof.#type - $
|
||||||
|
end if
|
||||||
|
common
|
||||||
|
sizeof.#name = $
|
||||||
|
end virtual
|
||||||
|
struc name [value] \{ \common
|
||||||
|
label .\#name
|
||||||
|
last@union equ
|
||||||
|
forward
|
||||||
|
match any, last@union \\{ virtual at .\#name
|
||||||
|
field type def
|
||||||
|
end virtual \\}
|
||||||
|
match , last@union \\{ match , value \\\{ field type def \\\}
|
||||||
|
match any, value \\\{ field type value \\\} \\}
|
||||||
|
last@union equ field
|
||||||
|
common rb sizeof.#name - ($ - .\#name) \} }
|
||||||
|
|
||||||
|
macro define@substruct parent,name,[field,type,def]
|
||||||
|
{ common
|
||||||
|
virtual at 0
|
||||||
|
forward
|
||||||
|
if ~ field eq .
|
||||||
|
parent#field type def
|
||||||
|
sizeof.#parent#field = $ - parent#field
|
||||||
|
else
|
||||||
|
rb sizeof.#type
|
||||||
|
end if
|
||||||
|
local value
|
||||||
|
common
|
||||||
|
sizeof.#name = $
|
||||||
|
end virtual
|
||||||
|
struc name value \{
|
||||||
|
label .\#name
|
||||||
|
forward
|
||||||
|
match , value \\{ field type def \\}
|
||||||
|
match any, value \\{ field type value
|
||||||
|
if ~ field eq .
|
||||||
|
rb sizeof.#parent#field - ($-field)
|
||||||
|
end if \\}
|
||||||
|
common \} }
|
||||||
|
|
||||||
; structures used in MeOS
|
; structures used in MeOS
|
||||||
struc process_information
|
|
||||||
{
|
|
||||||
.cpu_usage dd ? ; +0
|
|
||||||
.window_stack_position dw ? ; +4
|
|
||||||
.window_stack_value dw ? ; +6
|
|
||||||
.not_used1 dw ? ; +8
|
|
||||||
.process_name rb 12 ; +10
|
|
||||||
.memory_start dd ? ; +22
|
|
||||||
.used_memory dd ? ; +26
|
|
||||||
.PID dd ? ; +30
|
|
||||||
.x_start dd ? ; +34
|
|
||||||
.y_start dd ? ; +38
|
|
||||||
.x_size dd ? ; +42
|
|
||||||
.y_size dd ? ; +46
|
|
||||||
.slot_state dw ? ; +50
|
|
||||||
rb (1024-52)
|
|
||||||
}
|
|
||||||
struct process_information
|
struct process_information
|
||||||
|
cpu_usage dd ? ; +0
|
||||||
|
window_stack_position dw ? ; +4
|
||||||
|
window_stack_value dw ? ; +6
|
||||||
|
not_used1 dw ? ; +8
|
||||||
|
process_name rb 12 ; +10
|
||||||
|
memory_start dd ? ; +22
|
||||||
|
used_memory dd ? ; +26
|
||||||
|
PID dd ? ; +30
|
||||||
|
x_start dd ? ; +34
|
||||||
|
y_start dd ? ; +38
|
||||||
|
x_size dd ? ; +42
|
||||||
|
y_size dd ? ; +46
|
||||||
|
slot_state dw ? ; +50
|
||||||
|
rb (1024-52)
|
||||||
|
ends
|
||||||
|
|
||||||
struc system_colors
|
|
||||||
{
|
|
||||||
.frame dd ?
|
|
||||||
.grab dd ?
|
|
||||||
.grab_button dd ?
|
|
||||||
.grab_button_text dd ?
|
|
||||||
.grab_text dd ?
|
|
||||||
.work dd ?
|
|
||||||
.work_button dd ?
|
|
||||||
.work_button_text dd ?
|
|
||||||
.work_text dd ?
|
|
||||||
.work_graph dd ?
|
|
||||||
}
|
|
||||||
struct system_colors
|
struct system_colors
|
||||||
|
frame dd ?
|
||||||
|
grab dd ?
|
||||||
|
grab_button dd ?
|
||||||
|
grab_button_text dd ?
|
||||||
|
grab_text dd ?
|
||||||
|
work dd ?
|
||||||
|
work_button dd ?
|
||||||
|
work_button_text dd ?
|
||||||
|
work_text dd ?
|
||||||
|
work_graph dd ?
|
||||||
|
ends
|
||||||
|
|
||||||
|
|
||||||
; constants
|
; constants
|
||||||
@@ -247,20 +546,20 @@ struct system_colors
|
|||||||
EV_IDLE = 0
|
EV_IDLE = 0
|
||||||
EV_TIMER = 0
|
EV_TIMER = 0
|
||||||
EV_REDRAW = 1
|
EV_REDRAW = 1
|
||||||
EV_KEY = 2
|
EV_KEY = 2
|
||||||
EV_BUTTON = 3
|
EV_BUTTON = 3
|
||||||
EV_EXIT = 4
|
EV_EXIT = 4
|
||||||
EV_BACKGROUND = 5
|
EV_BACKGROUND = 5
|
||||||
EV_MOUSE = 6
|
EV_MOUSE = 6
|
||||||
EV_IPC = 7
|
EV_IPC = 7
|
||||||
EV_STACK = 8
|
EV_STACK = 8
|
||||||
|
|
||||||
; event mask bits for function 40
|
; event mask bits for function 40
|
||||||
EVM_REDRAW = 1b
|
EVM_REDRAW = 1b
|
||||||
EVM_KEY = 10b
|
EVM_KEY = 10b
|
||||||
EVM_BUTTON = 100b
|
EVM_BUTTON = 100b
|
||||||
EVM_EXIT = 1000b
|
EVM_EXIT = 1000b
|
||||||
EVM_BACKGROUND = 10000b
|
EVM_BACKGROUND = 10000b
|
||||||
EVM_MOUSE = 100000b
|
EVM_MOUSE = 100000b
|
||||||
EVM_IPC = 1000000b
|
EVM_IPC = 1000000b
|
||||||
EVM_STACK = 10000000b
|
EVM_STACK = 10000000b
|
||||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
File diff suppressed because it is too large
Load Diff
BIN
programs/fs/sysxtree/trunk/xtree.bmp
Normal file
BIN
programs/fs/sysxtree/trunk/xtree.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
BIN
programs/fs/sysxtree/trunk/xtree.ico
Normal file
BIN
programs/fs/sysxtree/trunk/xtree.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
87
programs/fs/sysxtree/trunk/xtreeinf.txt
Normal file
87
programs/fs/sysxtree/trunk/xtreeinf.txt
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
SYSTEM X-TREE
|
||||||
|
|
||||||
|
The new file browser with support sorting file by name, extension, size, date
|
||||||
|
Develop by Pavlushin Evgeni for Menuet OS e-mail: waptap@mail.ru
|
||||||
|
site (slow update) : www.deck4.narod.ru
|
||||||
|
|
||||||
|
~~~Manuals~~~
|
||||||
|
|
||||||
|
Copy program COPYR to ramdisk !!! for work feuters - copy and paste file's
|
||||||
|
|
||||||
|
~~~Keys~~~
|
||||||
|
PageUp\PageDown , Up Arrow/Down Arrow -Navigation
|
||||||
|
Blackspace - goto to previous folder
|
||||||
|
Enter - enter to folder or run/view/edit file
|
||||||
|
F2 - change sort mode (name,extension,size,date,sohw/fade del files)
|
||||||
|
F3 - view file in notepad
|
||||||
|
F5 - copy file to clipboard
|
||||||
|
F6 - paste file from clipboard
|
||||||
|
F12 - update source
|
||||||
|
|
||||||
|
SYSTEM X-TREE
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>,
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>.
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> Menuet OS e-mail: waptap@mail.ru
|
||||||
|
<20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) : www.deck4.narod.ru
|
||||||
|
|
||||||
|
~~~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>~~~
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> COPYR <20><> ramdisk !!! <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
~~~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>~~~
|
||||||
|
PageUp\PageDown , Up Arrow/Down Arrow - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
Blackspace - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
Enter - <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
|
F2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><> <20><><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD>)
|
||||||
|
F3 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
F5 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> clipboard
|
||||||
|
F6 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> clipboard'<27>
|
||||||
|
F12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
Translate of russian documentation for xtree
|
||||||
|
Sorry i'm write in English very poor.
|
||||||
|
|
||||||
|
The new concept of dialogues, now dialogues
|
||||||
|
is made do not use file system for an exchange
|
||||||
|
with the client, and use IPC - Inter process comunication
|
||||||
|
(Support since 52 Versions).
|
||||||
|
52 Version support IPC of dialogues
|
||||||
|
53 Version is added protection dialogs from
|
||||||
|
external processes.
|
||||||
|
Test with TESTOPDG 54 Version IPC protection it is
|
||||||
|
improved Test with TESTOPD2 That testing dialogues
|
||||||
|
copy SYSTRE54 on ramdisk under name SYSXTREE and start TESTOPD2
|
||||||
|
|
||||||
|
In window TESTOPD2 the following information is displayed:
|
||||||
|
In heading at the left???
|
||||||
|
Below parameters transferred SYSTEM XTREE,
|
||||||
|
namely PID TESTOPD2, the blank and
|
||||||
|
type of dialogue of one byte (O-Open, S-Save)
|
||||||
|
is even lower PID SYSTEM XTREE and current num of the
|
||||||
|
started processes After file will be open in dialogue,
|
||||||
|
it will be displayed in window TESTOPD2 below heading,
|
||||||
|
and dialogue will be closed.
|
||||||
|
|
||||||
|
Protection TESTOPD2:
|
||||||
|
1) If at start SYSTEM XTREE from XTREE don't it is
|
||||||
|
received it PID during 2 sec, 54 version XTREE or
|
||||||
|
not XTREE at all means on ramdisk not, TESTOPD2
|
||||||
|
comes to the end.
|
||||||
|
2) If worked SYSTEM XTREE it was closed not
|
||||||
|
having sent path to file (itself or from CPU programs)
|
||||||
|
TESTOPD2 comes to the end since parameters from XTREE
|
||||||
|
have not been received and since XTREE is closed
|
||||||
|
that already and don't are received.
|
||||||
|
|
||||||
|
;78Ver input in dir whith extension (for example TEST.DIR\XT\) bug deleted
|
||||||
|
;64Ver Run file from HD bug deleted.
|
||||||
|
;65Ver The bad scroll realization
|
||||||
|
;66Ver The good scroll realization, url line anti-flick
|
||||||
|
;67Ver Url line monolith procedure
|
||||||
|
;68Ver Mini icon on left of file name
|
||||||
|
;69Ver Getimg proc size minus 900 bytes
|
||||||
|
;70Ver Del data area ramsize minus 140000 bytes
|
||||||
|
;72Ver Quick sort, ramsize minus 200000 bytes
|
||||||
|
;73Ver Url flick and out bugs delete
|
||||||
|
;sort type in headmenu bug del
|
80
programs/fs/sysxtree/trunk/xtreinfo.txt
Normal file
80
programs/fs/sysxtree/trunk/xtreinfo.txt
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IPC -
|
||||||
|
Inter process comunication (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 52 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>).
|
||||||
|
|
||||||
|
52 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IPC <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
53 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> TESTOPDG
|
||||||
|
|
||||||
|
54 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IPC <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> TESTOPD2
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SYSTRE54 <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SYSXTREE <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TESTOPD2
|
||||||
|
|
||||||
|
<EFBFBD> <20><><EFBFBD><EFBFBD> TESTOPD2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||||
|
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ???
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SYSTEM XTREE , <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> PID TESTOPD2,
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (O-Open,S-Save)
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> PID SYSTEM XTREE <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> TESTOPD2 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TESTOPD2:
|
||||||
|
1) <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SYSTEM XTREE <20><> XTREE <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> PID
|
||||||
|
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2 <20><><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 54 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> XTREE <20><><EFBFBD> <20><> XTREE
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, TESTOPD2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||||
|
2) <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SYSTEM XTREE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD> <20><><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD> CPU <20><><EFBFBD><EFBFBD><EFBFBD>),<2C><> TESTOPD2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> XTREE <20><>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>.<2E>. XTREE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||||
|
|
||||||
|
68 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> X-TREE
|
||||||
|
<EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...
|
||||||
|
|
||||||
|
60Ver <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FileList <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||||
|
|
||||||
|
61Ver <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
62Ver <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
63Ver <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
64Ver <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> HD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
65Ver <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
66Ver <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> URL <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
67Ver <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> URL <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||||
|
|
||||||
|
68Ver <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>).
|
||||||
|
|
||||||
|
|
||||||
|
73 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
69Ver Getimg <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD> 900 <20><><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
70Ver data_area <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 140000 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!
|
||||||
|
|
||||||
|
72Ver <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> , fileinfo <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 200 <20><><EFBFBD><EFBFBD>,
|
||||||
|
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 200000 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!
|
||||||
|
|
||||||
|
73Ver <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Url <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>-<2D><> <20><> 900 <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
1 <20><>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> 600<30><30>, <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||||
|
|
||||||
|
|
||||||
|
80Ver <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> URL
|
||||||
|
|
||||||
|
81Ver Save <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
@@ -69,7 +69,7 @@ LABEL_PL2TYPE_Y equ LABEL_PL2_Y
|
|||||||
LABEL_STATUS_X equ 14
|
LABEL_STATUS_X equ 14
|
||||||
LABEL_STATUS_Y equ 279
|
LABEL_STATUS_Y equ 279
|
||||||
LABEL_STATUS_WIDTH equ 220
|
LABEL_STATUS_WIDTH equ 220
|
||||||
LABEL_STATUS_HEIGHT equ 8
|
LABEL_STATUS_HEIGHT equ 12
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,376 +0,0 @@
|
|||||||
;--------------------------------------------------------------
|
|
||||||
;DRAW BLOCK
|
|
||||||
;
|
|
||||||
;--------------------------------------------------------------
|
|
||||||
draw_block: mov eax,13
|
|
||||||
mov edx,[color_table+edx*4]
|
|
||||||
|
|
||||||
mov ebx,[current_block_x]
|
|
||||||
mov ecx,[current_block_y]
|
|
||||||
mov edi,[current_block_pointer]
|
|
||||||
|
|
||||||
sub ebx,BORDER_LEFT
|
|
||||||
imul ebx,ADOBE_SIZE
|
|
||||||
add ebx,X_LOCATION
|
|
||||||
shl ebx,16
|
|
||||||
mov bx,ADOBE_SIZE
|
|
||||||
|
|
||||||
sub ecx,BORDER_TOP
|
|
||||||
imul ecx,ADOBE_SIZE
|
|
||||||
add ecx,Y_LOCATION
|
|
||||||
shl ecx,16
|
|
||||||
mov cx,ADOBE_SIZE
|
|
||||||
|
|
||||||
mov dword [TMP_1],4
|
|
||||||
adr_122: mov dword [TMP_0],4
|
|
||||||
adr_121: cmp byte [edi],0
|
|
||||||
je adr_120
|
|
||||||
|
|
||||||
int 040h
|
|
||||||
|
|
||||||
call draw_frames
|
|
||||||
|
|
||||||
adr_120: inc edi
|
|
||||||
add ebx,ADOBE_SIZE*65536
|
|
||||||
dec dword [TMP_0]
|
|
||||||
jnz adr_121
|
|
||||||
sub ebx,4*ADOBE_SIZE*65536
|
|
||||||
add ecx,ADOBE_SIZE*65536
|
|
||||||
dec dword [TMP_1]
|
|
||||||
jnz adr_122
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
draw_frames:
|
|
||||||
cmp edx,0
|
|
||||||
jne df1
|
|
||||||
ret
|
|
||||||
df1:
|
|
||||||
pusha
|
|
||||||
mov bx,1
|
|
||||||
add edx,0x282828
|
|
||||||
mov eax,13
|
|
||||||
int 0x40
|
|
||||||
popa
|
|
||||||
|
|
||||||
pusha
|
|
||||||
mov cx,1
|
|
||||||
add edx,0x282828
|
|
||||||
mov eax,13
|
|
||||||
int 0x40
|
|
||||||
popa
|
|
||||||
|
|
||||||
pusha
|
|
||||||
push ebx
|
|
||||||
sub bx,1
|
|
||||||
add [esp+2],bx
|
|
||||||
pop ebx
|
|
||||||
mov bx,1
|
|
||||||
shr edx,1
|
|
||||||
and edx,0x7f7f7f
|
|
||||||
mov eax,13
|
|
||||||
int 0x40
|
|
||||||
popa
|
|
||||||
|
|
||||||
pusha
|
|
||||||
push ecx
|
|
||||||
sub cx,1
|
|
||||||
add [esp+2],cx
|
|
||||||
pop ecx
|
|
||||||
mov cx,1
|
|
||||||
shr edx,1
|
|
||||||
and edx,0x7f7f7f
|
|
||||||
mov eax,13
|
|
||||||
int 0x40
|
|
||||||
popa
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
; FIX BLOCK
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
fix_block: mov ebx,[current_block_pointer]
|
|
||||||
|
|
||||||
mov edx,[current_block_y]
|
|
||||||
imul edx,LEN_X
|
|
||||||
add edx,[current_block_x] ;find the offset in tetris_t
|
|
||||||
|
|
||||||
add edx,table_tetris
|
|
||||||
|
|
||||||
mov ecx,4
|
|
||||||
mov al,[current_block_color]
|
|
||||||
|
|
||||||
adr_21: cmp byte [ebx],1
|
|
||||||
jne adr_22
|
|
||||||
mov [edx],al
|
|
||||||
adr_22: inc ebx
|
|
||||||
inc edx
|
|
||||||
|
|
||||||
cmp byte [ebx],1
|
|
||||||
jne adr_23
|
|
||||||
mov [edx],al
|
|
||||||
adr_23: inc ebx
|
|
||||||
inc edx
|
|
||||||
|
|
||||||
cmp byte [ebx],1
|
|
||||||
jne adr_24
|
|
||||||
mov [edx],al
|
|
||||||
adr_24: inc ebx
|
|
||||||
inc edx
|
|
||||||
|
|
||||||
cmp byte [ebx],1
|
|
||||||
jne adr_25
|
|
||||||
mov [edx],al
|
|
||||||
adr_25: inc ebx
|
|
||||||
add edx,LEN_X-3
|
|
||||||
|
|
||||||
loop adr_21
|
|
||||||
ret
|
|
||||||
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
;NEW BLOCK
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
new_block: mov dword [current_block_y],1
|
|
||||||
mov dword [current_block_x],7
|
|
||||||
|
|
||||||
mov eax,dword [next_block_pointer]
|
|
||||||
mov dword [current_block_pointer],eax
|
|
||||||
|
|
||||||
mov eax,dword [next_block_color]
|
|
||||||
mov dword [current_block_color],eax
|
|
||||||
|
|
||||||
call random
|
|
||||||
and al,7
|
|
||||||
setz ah
|
|
||||||
add al,ah
|
|
||||||
mov [next_block_color],al
|
|
||||||
|
|
||||||
call random
|
|
||||||
;and eax,15
|
|
||||||
; ---- Ivan ----
|
|
||||||
and eax,0xff
|
|
||||||
@@:
|
|
||||||
cmp eax,_MAXBLOCKS_
|
|
||||||
jl @f
|
|
||||||
add eax,-(_MAXBLOCKS_)
|
|
||||||
jmp @b
|
|
||||||
@@:
|
|
||||||
; ---- Ivan ----
|
|
||||||
mov edx,[block_table+eax*4]
|
|
||||||
mov [next_block_pointer],edx
|
|
||||||
|
|
||||||
mov dword[delay],5
|
|
||||||
sub dword[delay],speed
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
;DRAW TITLE BLOCK
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
draw_title_block:
|
|
||||||
; movzx edx,byte [current_block_color]
|
|
||||||
mov eax,13
|
|
||||||
|
|
||||||
; mov edx,[color_table+edx*4]
|
|
||||||
|
|
||||||
; mov ebx,[current_block_x]
|
|
||||||
; mov ecx,[current_block_y]
|
|
||||||
; mov edi,[current_block_pointer]
|
|
||||||
|
|
||||||
sub ebx,BORDER_LEFT
|
|
||||||
imul ebx,ADOBE_SIZE
|
|
||||||
add ebx,X_LOCATION
|
|
||||||
shl ebx,16
|
|
||||||
mov bx,ADOBE_SIZE
|
|
||||||
|
|
||||||
sub ecx,BORDER_TOP
|
|
||||||
imul ecx,ADOBE_SIZE
|
|
||||||
add ecx,Y_LOCATION
|
|
||||||
shl ecx,16
|
|
||||||
mov cx,ADOBE_SIZE
|
|
||||||
|
|
||||||
mov dword [TMP_1],5
|
|
||||||
call adr_122
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
;FIRST BLOCK
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
first_block: call random
|
|
||||||
and al,7
|
|
||||||
setz ah
|
|
||||||
add al,ah
|
|
||||||
mov [next_block_color],al
|
|
||||||
|
|
||||||
call random
|
|
||||||
;and eax,15
|
|
||||||
; ---- Ivan ----
|
|
||||||
and eax,0xff
|
|
||||||
@@:
|
|
||||||
cmp eax,_MAXBLOCKS_
|
|
||||||
jl @f
|
|
||||||
add eax,-(_MAXBLOCKS_)
|
|
||||||
jmp @b
|
|
||||||
@@:
|
|
||||||
; ---- Ivan ----
|
|
||||||
mov edx,[block_table+eax*4]
|
|
||||||
mov [next_block_pointer],edx
|
|
||||||
|
|
||||||
; call draw_next_block
|
|
||||||
|
|
||||||
; mov byte [delay],5 ;19 ;!!! 15
|
|
||||||
ret
|
|
||||||
ret
|
|
||||||
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
;DRAW NEXT BLOCK
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
|
|
||||||
draw_next_block:
|
|
||||||
movzx edx,byte [next_block_color]
|
|
||||||
mov eax,13
|
|
||||||
mov edx,[color_table+edx*4]
|
|
||||||
|
|
||||||
mov ebx,LEN_X+1
|
|
||||||
mov ecx,5
|
|
||||||
mov edi,[next_block_pointer]
|
|
||||||
|
|
||||||
sub ebx,BORDER_LEFT
|
|
||||||
imul ebx,ADOBE_SIZE
|
|
||||||
add ebx,X_LOCATION
|
|
||||||
shl ebx,16
|
|
||||||
mov bx,ADOBE_SIZE
|
|
||||||
|
|
||||||
sub ecx,BORDER_TOP
|
|
||||||
imul ecx,ADOBE_SIZE
|
|
||||||
add ecx,Y_LOCATION
|
|
||||||
shl ecx,16
|
|
||||||
mov cx,ADOBE_SIZE
|
|
||||||
|
|
||||||
mov dword [TMP_1],4
|
|
||||||
jmp adr_122
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
; ROTATE BLOCK
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
|
|
||||||
rotate_block:
|
|
||||||
mov edx,[current_block_pointer]
|
|
||||||
mov edx,[edx+16]
|
|
||||||
mov esi,[current_block_pointer]
|
|
||||||
mov [current_block_pointer],edx
|
|
||||||
call check_crash
|
|
||||||
call attesa
|
|
||||||
mov [current_block_pointer],esi
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
; CHECK CRASH
|
|
||||||
; output Z flag => OK
|
|
||||||
; NZ flag => NO
|
|
||||||
;-------------------------------------------------------------
|
|
||||||
|
|
||||||
check_crash: mov ebx,[current_block_pointer]
|
|
||||||
|
|
||||||
mov edx,[current_block_y]
|
|
||||||
imul edx,LEN_X
|
|
||||||
add edx,[current_block_x] ;find the offset in tetris_t
|
|
||||||
|
|
||||||
add edx,table_tetris
|
|
||||||
|
|
||||||
mov ecx,4
|
|
||||||
xor ax,ax
|
|
||||||
|
|
||||||
adr_1: cmp byte [ebx],1
|
|
||||||
jne adr_2
|
|
||||||
add al,[edx]
|
|
||||||
adc ah,0
|
|
||||||
adr_2: inc ebx
|
|
||||||
inc edx
|
|
||||||
|
|
||||||
cmp byte [ebx],1
|
|
||||||
jne adr_3
|
|
||||||
add al,[edx]
|
|
||||||
adc ah,0
|
|
||||||
adr_3: inc ebx
|
|
||||||
inc edx
|
|
||||||
|
|
||||||
cmp byte [ebx],1
|
|
||||||
jne adr_4
|
|
||||||
add al,[edx]
|
|
||||||
adc ah,0
|
|
||||||
adr_4: inc ebx
|
|
||||||
inc edx
|
|
||||||
|
|
||||||
cmp byte [ebx],1
|
|
||||||
jne adr_5
|
|
||||||
add al,[edx]
|
|
||||||
adc ah,0
|
|
||||||
adr_5: inc ebx
|
|
||||||
add edx,LEN_X-3
|
|
||||||
|
|
||||||
loop adr_1
|
|
||||||
or ax,ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
;--------------------------------------------------------------
|
|
||||||
;CHECK LINE
|
|
||||||
;--------------------------------------------------------------
|
|
||||||
;edx = pointer
|
|
||||||
;ebx = contatore
|
|
||||||
check_full_line:
|
|
||||||
std
|
|
||||||
mov al,0
|
|
||||||
mov edx,table_tetris+LEN_X*(LEN_Y-BORDER_BOTTOM)-1
|
|
||||||
mov ebx,(LEN_Y-BORDER_TOP-BORDER_BOTTOM-1)*LEN_X
|
|
||||||
|
|
||||||
adr_5000: mov edi,edx
|
|
||||||
mov ecx,LEN_X-BORDER_LEFT-BORDER_RIGHT
|
|
||||||
repne scasb
|
|
||||||
jz no_full_line
|
|
||||||
|
|
||||||
lea esi,[edx-LEN_X]
|
|
||||||
mov edi,edx
|
|
||||||
mov ecx,ebx
|
|
||||||
rep movsb
|
|
||||||
sub edi,BORDER_RIGHT
|
|
||||||
mov ecx,LEN_X-BORDER_LEFT-BORDER_RIGHT
|
|
||||||
rep stosb
|
|
||||||
|
|
||||||
add dword [score],100
|
|
||||||
add dword [lines],1
|
|
||||||
|
|
||||||
; mov esi,dword[score]
|
|
||||||
;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
;
|
|
||||||
; mov esi,dword [speed]
|
|
||||||
; imul esi,linestonewlevel
|
|
||||||
; add esi,linestonewlevel
|
|
||||||
; cmp dword [lines],esi
|
|
||||||
; jne adr_5000 1 line : 100
|
|
||||||
; cmp dword[speed],4 2 lines: 300
|
|
||||||
; je adr_51 3 lines: 700
|
|
||||||
; inc dword[speed] 4 lines:1500
|
|
||||||
; jmp adr_5000
|
|
||||||
; adr_51:
|
|
||||||
; mov dword[speed],0
|
|
||||||
;
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
|
|
||||||
jmp adr_5000
|
|
||||||
|
|
||||||
no_full_line: sub edx,LEN_X
|
|
||||||
sub ebx,LEN_X
|
|
||||||
jnz adr_5000
|
|
||||||
|
|
||||||
ret
|
|
@@ -1,235 +0,0 @@
|
|||||||
;+---------------------------------+
|
|
||||||
;| DEFINITION BLOCKS |
|
|
||||||
;+---------------------------------+
|
|
||||||
|
|
||||||
t_block_0:
|
|
||||||
db 0,0,0,0
|
|
||||||
db 1,1,1,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd t_block_3
|
|
||||||
|
|
||||||
t_block_1:
|
|
||||||
db 0,1,0,0
|
|
||||||
db 1,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd t_block_0
|
|
||||||
|
|
||||||
t_block_2:
|
|
||||||
db 0,1,0,0
|
|
||||||
db 1,1,1,0
|
|
||||||
db 0,0,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd t_block_1
|
|
||||||
|
|
||||||
t_block_3:
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,1,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd t_block_2
|
|
||||||
|
|
||||||
;-----------------------------------
|
|
||||||
|
|
||||||
i_block_0:
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
dd i_block_1
|
|
||||||
|
|
||||||
i_block_1:
|
|
||||||
db 0,0,0,0
|
|
||||||
db 1,1,1,1
|
|
||||||
db 0,0,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd i_block_0
|
|
||||||
;-----------------------------------
|
|
||||||
|
|
||||||
q_block_0:
|
|
||||||
db 0,1,1,0
|
|
||||||
db 0,1,1,0
|
|
||||||
db 0,0,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd q_block_0
|
|
||||||
|
|
||||||
;-----------------------------------
|
|
||||||
|
|
||||||
s_block_0:
|
|
||||||
db 0,0,0,0
|
|
||||||
db 0,1,1,0
|
|
||||||
db 1,1,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd s_block_1
|
|
||||||
|
|
||||||
s_block_1:
|
|
||||||
db 1,0,0,0
|
|
||||||
db 1,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd s_block_0
|
|
||||||
|
|
||||||
;-----------------------------------
|
|
||||||
|
|
||||||
l_block_0:
|
|
||||||
db 0,0,0,0
|
|
||||||
db 1,1,1,0
|
|
||||||
db 1,0,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd l_block_3
|
|
||||||
|
|
||||||
l_block_1:
|
|
||||||
db 1,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd l_block_0
|
|
||||||
|
|
||||||
l_block_2:
|
|
||||||
db 0,0,1,0
|
|
||||||
db 1,1,1,0
|
|
||||||
db 0,0,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd l_block_1
|
|
||||||
|
|
||||||
l_block_3:
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,1,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd l_block_2
|
|
||||||
|
|
||||||
;-----------------------------------
|
|
||||||
|
|
||||||
g_block_0:
|
|
||||||
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 1,1,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd g_block_1
|
|
||||||
|
|
||||||
g_block_1:
|
|
||||||
db 0,0,0,0
|
|
||||||
db 1,1,1,0
|
|
||||||
db 0,0,1,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd g_block_2
|
|
||||||
|
|
||||||
g_block_2:
|
|
||||||
db 0,1,1,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd g_block_3
|
|
||||||
|
|
||||||
g_block_3:
|
|
||||||
db 1,0,0,0
|
|
||||||
db 1,1,1,0
|
|
||||||
db 0,0,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd g_block_0
|
|
||||||
|
|
||||||
;-----------------------------------
|
|
||||||
|
|
||||||
k_block_0:
|
|
||||||
db 0,0,0,0
|
|
||||||
db 1,1,0,0
|
|
||||||
db 0,1,1,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd k_block_1
|
|
||||||
|
|
||||||
k_block_1:
|
|
||||||
db 0,1,0,0
|
|
||||||
db 1,1,0,0
|
|
||||||
db 1,0,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
dd k_block_0
|
|
||||||
|
|
||||||
;-----------------------------------
|
|
||||||
;logo blocks
|
|
||||||
;-----------------------------------
|
|
||||||
|
|
||||||
tetris_t:
|
|
||||||
db 1,1,1,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
|
|
||||||
tetris_e:
|
|
||||||
db 1,1,1,0
|
|
||||||
db 1,0,0,0
|
|
||||||
db 1,1,0,0
|
|
||||||
db 1,0,0,0
|
|
||||||
db 1,1,1,0
|
|
||||||
|
|
||||||
tetris_r:
|
|
||||||
db 1,1,0,0
|
|
||||||
db 1,0,1,0
|
|
||||||
db 1,1,0,0
|
|
||||||
db 1,0,1,0
|
|
||||||
db 1,0,1,0
|
|
||||||
|
|
||||||
tetris_i:
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,0,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
db 0,1,0,0
|
|
||||||
|
|
||||||
tetris_s:
|
|
||||||
db 0,1,1,1
|
|
||||||
db 1,0,0,0
|
|
||||||
db 0,1,1,0
|
|
||||||
db 0,0,0,1
|
|
||||||
db 1,1,1,0
|
|
||||||
|
|
||||||
tetris_II:
|
|
||||||
db 1,1,1,1
|
|
||||||
db 0,1,1,0
|
|
||||||
db 0,1,1,0
|
|
||||||
db 0,1,1,0
|
|
||||||
db 1,1,1,1
|
|
||||||
|
|
||||||
;-----------------------------------
|
|
||||||
block_table:
|
|
||||||
dd t_block_0 ; t
|
|
||||||
dd t_block_1
|
|
||||||
dd t_block_2
|
|
||||||
dd t_block_3
|
|
||||||
dd i_block_0 ; i
|
|
||||||
dd i_block_1
|
|
||||||
dd i_block_0
|
|
||||||
dd i_block_1
|
|
||||||
dd q_block_0 ; q
|
|
||||||
dd q_block_0
|
|
||||||
dd q_block_0
|
|
||||||
dd q_block_0
|
|
||||||
dd s_block_0 ; s
|
|
||||||
dd s_block_1
|
|
||||||
dd s_block_0
|
|
||||||
dd s_block_1
|
|
||||||
dd l_block_0 ; l
|
|
||||||
dd l_block_1
|
|
||||||
dd l_block_2
|
|
||||||
dd l_block_3
|
|
||||||
dd g_block_0 ; g
|
|
||||||
dd g_block_1
|
|
||||||
dd g_block_2
|
|
||||||
dd g_block_3
|
|
||||||
dd k_block_0 ; k
|
|
||||||
dd k_block_1
|
|
||||||
dd k_block_0
|
|
||||||
dd k_block_1
|
|
||||||
|
|
||||||
color_table:
|
|
||||||
dd 00000000h ;black 0
|
|
||||||
dd 00cccccch ;white 1
|
|
||||||
dd 00cc0000h ;red 2
|
|
||||||
dd 0000cc00h ;green 3
|
|
||||||
dd 000000cch ;blue 4
|
|
||||||
dd 00cccc00h ;yellow 5
|
|
||||||
dd 0000cccch ;cyan 6
|
|
||||||
dd 00cc00cch ;pink 7
|
|
@@ -1,161 +0,0 @@
|
|||||||
UP_KEY equ 178 ; the ascii keycodes of some keys
|
|
||||||
DOWN_KEY equ 177
|
|
||||||
LEFT_KEY equ 176
|
|
||||||
RIGHT_KEY equ 179
|
|
||||||
ENTER_KEY equ 13
|
|
||||||
ESCAPE_KEY equ 27
|
|
||||||
|
|
||||||
key:
|
|
||||||
mov eax,2 ; Read key ascii and store it into ah
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
cmp ah,LEFT_KEY ; Check if left key is pressed
|
|
||||||
jne no_left
|
|
||||||
|
|
||||||
cmp byte[status],'1'
|
|
||||||
jne no_left
|
|
||||||
go_left:
|
|
||||||
dec dword [current_block_x]
|
|
||||||
call check_crash
|
|
||||||
jz no_left
|
|
||||||
inc dword [current_block_x]
|
|
||||||
|
|
||||||
no_left:
|
|
||||||
cmp ah,RIGHT_KEY ; Check if right key is pressed
|
|
||||||
jne no_right
|
|
||||||
|
|
||||||
cmp byte[status],'1'
|
|
||||||
jne no_right
|
|
||||||
go_right:
|
|
||||||
inc dword [current_block_x]
|
|
||||||
call check_crash
|
|
||||||
jz no_right
|
|
||||||
dec dword [current_block_x]
|
|
||||||
|
|
||||||
no_right:
|
|
||||||
cmp ah,UP_KEY ; Compare pressed key with up key
|
|
||||||
jne no_up ; Jump to nu_up if up key isnt pressed
|
|
||||||
|
|
||||||
cmp byte[status],'0' ; Check if menu is running
|
|
||||||
jne no_menu2 ; Jump to no_up ifgame isnt running
|
|
||||||
|
|
||||||
cmp byte[menu],'0' ; Compare menu state with 0
|
|
||||||
jne no_menu0 ; Jump to no_menu0 if menu state isnt zero
|
|
||||||
|
|
||||||
mov byte[menu],'3' ; Change menu state to 2
|
|
||||||
call draw_window ; Redraw the window
|
|
||||||
jmp no_menu2 ; Jump to no_menu2
|
|
||||||
|
|
||||||
no_menu0:
|
|
||||||
dec byte[menu] ; menu state = menu state - 1
|
|
||||||
call draw_window ; Redraw the window
|
|
||||||
|
|
||||||
no_menu2:
|
|
||||||
cmp byte[status],'1' ; Compare game state with 1
|
|
||||||
jne no_up ; Jump to no_up if game state isnt 1 (if game isnt running)
|
|
||||||
|
|
||||||
call rotate_block
|
|
||||||
|
|
||||||
no_up:
|
|
||||||
cmp ah,DOWN_KEY ; Check if down key is pressed
|
|
||||||
jne no_down
|
|
||||||
|
|
||||||
cmp byte[status],'0'
|
|
||||||
jne no_menu3
|
|
||||||
|
|
||||||
cmp byte[menu],'3'
|
|
||||||
jne no_menu1
|
|
||||||
|
|
||||||
mov byte[menu],'0'
|
|
||||||
call draw_window
|
|
||||||
jmp no_menu3
|
|
||||||
|
|
||||||
no_menu1:
|
|
||||||
inc byte[menu]
|
|
||||||
call draw_window
|
|
||||||
|
|
||||||
no_menu3:
|
|
||||||
cmp byte[status],'1'
|
|
||||||
jne no_down
|
|
||||||
|
|
||||||
inc dword [current_block_y]
|
|
||||||
call check_crash
|
|
||||||
jne block_crash
|
|
||||||
jmp still
|
|
||||||
|
|
||||||
|
|
||||||
no_down:
|
|
||||||
cmp ah,'n' ; Check if n key is pressed
|
|
||||||
jne no_n
|
|
||||||
jmp new_game
|
|
||||||
|
|
||||||
no_n:
|
|
||||||
cmp ah,'p' ; Check if p key is pressed
|
|
||||||
jne no_p
|
|
||||||
cmp byte[status],'2'
|
|
||||||
je unpause
|
|
||||||
cmp byte[status],'1' ; add this two line or p will work
|
|
||||||
jne no_p ; when your still in the menu
|
|
||||||
mov byte[status],'2'
|
|
||||||
call draw_window
|
|
||||||
jmp attesa
|
|
||||||
unpause:
|
|
||||||
mov byte[status],'1'
|
|
||||||
call draw_window
|
|
||||||
jmp still
|
|
||||||
|
|
||||||
no_p:
|
|
||||||
cmp byte[status],'0'
|
|
||||||
jne no_menu
|
|
||||||
|
|
||||||
no_menu:
|
|
||||||
cmp byte[status],'1'
|
|
||||||
jne no_game
|
|
||||||
|
|
||||||
no_game:
|
|
||||||
cmp byte[status],'2'
|
|
||||||
jne no_pause1
|
|
||||||
|
|
||||||
no_pause1:
|
|
||||||
cmp ah,ENTER_KEY ; Check if enter key is pressed
|
|
||||||
jne no_enter
|
|
||||||
cmp byte[status],'0'
|
|
||||||
jne no_enter
|
|
||||||
call exemenu
|
|
||||||
|
|
||||||
no_enter:
|
|
||||||
cmp ah,ESCAPE_KEY ; Check if escape key is pressed
|
|
||||||
jne no_escape
|
|
||||||
|
|
||||||
|
|
||||||
cmp byte[status],'0'
|
|
||||||
jne no_instr1
|
|
||||||
mov eax,-1
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
no_instr1:
|
|
||||||
cmp byte[status],'1'
|
|
||||||
jne no_menu4
|
|
||||||
mov byte[status],'0'
|
|
||||||
call draw_window
|
|
||||||
|
|
||||||
no_menu4:
|
|
||||||
cmp byte[status],'3'
|
|
||||||
jne no_menu5
|
|
||||||
mov byte[status],'0'
|
|
||||||
call draw_window
|
|
||||||
|
|
||||||
no_menu5:
|
|
||||||
cmp byte[status],'4'
|
|
||||||
jne no_escape
|
|
||||||
mov byte[status],'0'
|
|
||||||
call draw_window
|
|
||||||
|
|
||||||
no_escape:
|
|
||||||
|
|
||||||
cmp byte[status],'1'
|
|
||||||
jne still
|
|
||||||
jmp scendi
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
@@ -1,137 +0,0 @@
|
|||||||
draw_menu:
|
|
||||||
|
|
||||||
cmp byte[menu],'0'
|
|
||||||
jne menu1
|
|
||||||
|
|
||||||
mov eax,4
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-39)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*4)
|
|
||||||
mov ecx,0x10ffff00
|
|
||||||
mov edx,startgame
|
|
||||||
mov esi,instr-startgame
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-84)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*5)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,instr
|
|
||||||
mov esi,hist-instr
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-50)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*6)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,hist
|
|
||||||
mov esi,quit-hist
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-26)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*7)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,quit
|
|
||||||
mov esi,paused-quit
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
menu1:
|
|
||||||
cmp byte[menu],'1'
|
|
||||||
jne menu2
|
|
||||||
|
|
||||||
|
|
||||||
mov eax,4
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-39)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*4)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,startgame
|
|
||||||
mov esi,instr-startgame
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-84)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*5)
|
|
||||||
mov ecx,0x10ffff00
|
|
||||||
mov edx,instr
|
|
||||||
mov esi,hist-instr
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-50)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*6)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,hist
|
|
||||||
mov esi,quit-hist
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-26)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*7)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,quit
|
|
||||||
mov esi,paused-quit
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
menu2:
|
|
||||||
cmp byte[menu],'2'
|
|
||||||
jne menu3
|
|
||||||
|
|
||||||
mov eax,4
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-39)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*4)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,startgame
|
|
||||||
mov esi,instr-startgame
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-84)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*5)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,instr
|
|
||||||
mov esi,hist-instr
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-50)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*6)
|
|
||||||
mov ecx,0x10ffff00
|
|
||||||
mov edx,hist
|
|
||||||
mov esi,quit-hist
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-26)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*7)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,quit
|
|
||||||
mov esi,paused-quit
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
menu3:
|
|
||||||
cmp byte[menu],'3'
|
|
||||||
jne menu4
|
|
||||||
|
|
||||||
mov eax,4
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-39)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*4)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,startgame
|
|
||||||
mov esi,instr-startgame
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-84)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*5)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,instr
|
|
||||||
mov esi,hist-instr
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-50)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*6)
|
|
||||||
mov ecx,0x10ff0000
|
|
||||||
mov edx,hist
|
|
||||||
mov esi,quit-hist
|
|
||||||
int 0x40
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98-26)/2*65536+(((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-2)/8*7)
|
|
||||||
mov ecx,0x10ffff00
|
|
||||||
mov edx,quit
|
|
||||||
mov esi,paused-quit
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
menu4:
|
|
||||||
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
exemenu:
|
|
||||||
cmp byte[menu],'0' ;start
|
|
||||||
jne exemenu1
|
|
||||||
call new_game
|
|
||||||
|
|
||||||
exemenu1:
|
|
||||||
cmp byte[menu],'1' ;instr
|
|
||||||
jne exemenu2
|
|
||||||
mov byte[status],'4'
|
|
||||||
call draw_window
|
|
||||||
|
|
||||||
exemenu2:
|
|
||||||
cmp byte[menu],'2' ;history
|
|
||||||
jne exemenu3
|
|
||||||
mov byte[status],'3'
|
|
||||||
call draw_window
|
|
||||||
|
|
||||||
exemenu3:
|
|
||||||
cmp byte[menu],'3' ;exit
|
|
||||||
jne exemenu4
|
|
||||||
mov eax,-1
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
exemenu4:
|
|
||||||
|
|
||||||
ret
|
|
@@ -1,87 +0,0 @@
|
|||||||
mouse:
|
|
||||||
|
|
||||||
|
|
||||||
mov eax,37 ; get mouse position ; EXPERIMENTAL !!!
|
|
||||||
mov ebx,1 ; window relative ;
|
|
||||||
int 0x40 ; ;
|
|
||||||
shr eax,16 ; we only need to know the x position ;
|
|
||||||
sub eax,X_LOCATION ;
|
|
||||||
;
|
|
||||||
cmp eax,ADOBE_SIZE*(LEN_X-2) ; check to see if mouse is in field ;
|
|
||||||
jg no_mouse ; ;
|
|
||||||
cmp eax,0 ; ;
|
|
||||||
jl no_mouse ; ;
|
|
||||||
;
|
|
||||||
mov ebx,0 ;
|
|
||||||
;
|
|
||||||
mouseloop: ;
|
|
||||||
cmp eax,ADOBE_SIZE ;
|
|
||||||
jl yes_mouse ;
|
|
||||||
sub eax,ADOBE_SIZE ;
|
|
||||||
inc ebx ;
|
|
||||||
jmp mouseloop ;
|
|
||||||
;
|
|
||||||
yes_mouse: ;
|
|
||||||
cmp ebx,[current_block_x]
|
|
||||||
jg go_right
|
|
||||||
jl go_left
|
|
||||||
; mov dword[current_block_x],ebx ;
|
|
||||||
|
|
||||||
mov eax,37 ; get mouse position ;
|
|
||||||
mov ebx,2 ; buttons pressed (1=left, 2=right, 3=both) ;
|
|
||||||
int 0x40 ;
|
|
||||||
;
|
|
||||||
cmp eax,0 ;
|
|
||||||
jne yes_mouse_button ;
|
|
||||||
mov byte[lastmousebutton],0 ;
|
|
||||||
jmp no_mouse ;
|
|
||||||
yes_mouse_button: ;
|
|
||||||
;
|
|
||||||
cmp eax,2 ;
|
|
||||||
jne no_left_mouse ;
|
|
||||||
cmp byte[status],'1' ;
|
|
||||||
jne no_left_mouse ;
|
|
||||||
mov byte[lastmousebutton],2 ;
|
|
||||||
inc dword [current_block_y] ;
|
|
||||||
call check_crash ;
|
|
||||||
jne block_crash ;
|
|
||||||
jmp no_mouse ;
|
|
||||||
;
|
|
||||||
no_left_mouse: ;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
cmp eax,1 ;
|
|
||||||
jne no_right_mouse ;
|
|
||||||
cmp byte[status],'1' ;
|
|
||||||
jne no_right_mouse ;
|
|
||||||
cmp byte[lastmousebutton],1 ;
|
|
||||||
mov byte[lastmousebutton],1 ;
|
|
||||||
je no_right_mouse ;
|
|
||||||
call rotate_block ;
|
|
||||||
call check_crash ;
|
|
||||||
jne block_crash ;
|
|
||||||
call draw_block ;
|
|
||||||
jmp scendi ;
|
|
||||||
;
|
|
||||||
no_right_mouse: ;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
cmp eax,3 ;
|
|
||||||
jne no_mouse ;
|
|
||||||
cmp byte[lastmousebutton],3 ;
|
|
||||||
mov byte[lastmousebutton],3 ;
|
|
||||||
je no_mouse ;
|
|
||||||
cmp byte[status],'2' ;
|
|
||||||
je unpause ;
|
|
||||||
mov byte[status],'2' ;
|
|
||||||
call draw_window ;
|
|
||||||
jmp attesa ;
|
|
||||||
; unpause: ;
|
|
||||||
; mov byte[status],'1' ;
|
|
||||||
; call draw_window ;
|
|
||||||
; jmp still ;
|
|
||||||
;
|
|
||||||
; ;
|
|
||||||
no_mouse: ;
|
|
||||||
|
|
||||||
ret
|
|
@@ -1,18 +0,0 @@
|
|||||||
;--------------------------------------------------------------
|
|
||||||
|
|
||||||
random: mov eax,[generator]
|
|
||||||
add eax,-43ab45b5h
|
|
||||||
ror eax,1
|
|
||||||
xor eax,32c4324fh
|
|
||||||
ror eax,1
|
|
||||||
mov [generator],eax
|
|
||||||
; --- IVAN ---
|
|
||||||
push ebx
|
|
||||||
mov eax,22
|
|
||||||
mov ebx,9
|
|
||||||
int 0x40
|
|
||||||
pop ebx
|
|
||||||
xor eax,0xdeadbeef
|
|
||||||
add eax,[generator]
|
|
||||||
; --- IVAN ---
|
|
||||||
ret
|
|
@@ -1,100 +0,0 @@
|
|||||||
write_score:
|
|
||||||
|
|
||||||
mov eax,13
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2-3)*65536+95 ;clear box to write new score
|
|
||||||
mov ecx,20*65536+((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION-20)
|
|
||||||
mov edx,0x00000000
|
|
||||||
int 40h
|
|
||||||
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2)*65536+25 ; draw info text with function 4
|
|
||||||
mov ecx,0xffff00 ; color
|
|
||||||
mov edx,scoretext
|
|
||||||
mov esi,linestext-scoretext
|
|
||||||
mov eax,4
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
mov eax,[score]
|
|
||||||
call number_to_str
|
|
||||||
|
|
||||||
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+35)*65536+25 ; draw info text with function 4
|
|
||||||
mov ecx,0xffff00 ; color
|
|
||||||
mov edx,number_str
|
|
||||||
mov esi,[size_of_number_str]
|
|
||||||
mov eax,4
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2)*65536+35 ; draw info text with function 4
|
|
||||||
mov ecx,0xffff00 ; color
|
|
||||||
mov edx,linestext
|
|
||||||
mov esi,speedtext-linestext
|
|
||||||
mov eax,4
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
mov eax,[lines]
|
|
||||||
call number_to_str
|
|
||||||
|
|
||||||
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+35)*65536+35 ; draw info text with function 4
|
|
||||||
mov ecx,0xffff00 ; color
|
|
||||||
mov edx,number_str
|
|
||||||
mov esi,[size_of_number_str]
|
|
||||||
mov eax,4
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2)*65536+45 ; draw info text with function 4
|
|
||||||
mov ecx,0xffff00 ; color
|
|
||||||
mov edx,speedtext
|
|
||||||
mov esi,leveltext-speedtext
|
|
||||||
mov eax,4
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
mov eax,[speed]
|
|
||||||
call number_to_str
|
|
||||||
|
|
||||||
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+35)*65536+45 ; draw info text with function 4
|
|
||||||
mov ecx,0xffff00 ; color
|
|
||||||
mov edx,number_str
|
|
||||||
mov esi,[size_of_number_str]
|
|
||||||
mov eax,4
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2)*65536+55 ; draw info text with function 4
|
|
||||||
mov ecx,0xffff00 ; color
|
|
||||||
mov edx,leveltext
|
|
||||||
mov esi,startgame-leveltext
|
|
||||||
mov eax,4
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
mov eax,[level]
|
|
||||||
call number_to_str
|
|
||||||
|
|
||||||
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+35)*65536+55 ; draw info text with function 4
|
|
||||||
mov ecx,0xffff00 ; color
|
|
||||||
mov edx,number_str
|
|
||||||
mov esi,[size_of_number_str]
|
|
||||||
mov eax,4
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
call draw_next_block
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
number_to_str:
|
|
||||||
|
|
||||||
mov edi,end_number_str-1
|
|
||||||
mov ecx,9;size_of_number_str
|
|
||||||
mov ebx,10
|
|
||||||
cld
|
|
||||||
new_digit:
|
|
||||||
xor edx,edx
|
|
||||||
div ebx
|
|
||||||
add dl,'0'
|
|
||||||
mov [edi],dl
|
|
||||||
dec edi
|
|
||||||
loop new_digit
|
|
||||||
|
|
||||||
ret
|
|
@@ -1,56 +0,0 @@
|
|||||||
;--------------------------------------------------------------
|
|
||||||
; DRAW_TABLE
|
|
||||||
;--------------------------------------------------------------
|
|
||||||
draw_table: mov esi,table_tetris+LEN_X*BORDER_TOP+BORDER_LEFT
|
|
||||||
|
|
||||||
mov ebx,X_LOCATION*65536+ADOBE_SIZE
|
|
||||||
mov ecx,Y_LOCATION*65536+ADOBE_SIZE
|
|
||||||
mov edi,LEN_Y-BORDER_TOP-BORDER_BOTTOM
|
|
||||||
y_draw: push edi
|
|
||||||
|
|
||||||
mov edi,LEN_X-BORDER_LEFT-BORDER_RIGHT
|
|
||||||
x_draw: push edi
|
|
||||||
mov ax,13
|
|
||||||
movzx edx,byte [esi]
|
|
||||||
mov edx,[color_table+edx*4]
|
|
||||||
int 0x40
|
|
||||||
call draw_frames
|
|
||||||
inc esi
|
|
||||||
add ebx,65536*ADOBE_SIZE
|
|
||||||
pop edi
|
|
||||||
dec edi
|
|
||||||
jnz x_draw
|
|
||||||
|
|
||||||
add esi,BORDER_LEFT+BORDER_RIGHT
|
|
||||||
mov ebx,X_LOCATION*65536+ADOBE_SIZE
|
|
||||||
add ecx,65536*ADOBE_SIZE
|
|
||||||
pop edi
|
|
||||||
dec edi
|
|
||||||
jnz y_draw
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
;--------------------------------------------------------------
|
|
||||||
|
|
||||||
clear_table_tetris:
|
|
||||||
cld
|
|
||||||
mov al,1
|
|
||||||
mov edi,table_tetris
|
|
||||||
mov ecx,LEN_X*BORDER_TOP
|
|
||||||
rep stosb
|
|
||||||
|
|
||||||
mov edx,LEN_Y-BORDER_TOP-BORDER_BOTTOM
|
|
||||||
adr300: mov cl,BORDER_LEFT
|
|
||||||
rep stosb
|
|
||||||
dec ax ;AL=0
|
|
||||||
mov cl,LEN_X-BORDER_LEFT-BORDER_RIGHT
|
|
||||||
rep stosb
|
|
||||||
inc ax ;AL=1
|
|
||||||
mov cl,BORDER_RIGHT
|
|
||||||
rep stosb
|
|
||||||
dec dx
|
|
||||||
jne adr300
|
|
||||||
|
|
||||||
mov ecx,LEN_X*BORDER_BOTTOM
|
|
||||||
rep stosb
|
|
||||||
ret
|
|
File diff suppressed because it is too large
Load Diff
@@ -1,142 +0,0 @@
|
|||||||
draw_window:
|
|
||||||
|
|
||||||
|
|
||||||
mov eax,12 ; function 12:tell os about windowdraw
|
|
||||||
mov ebx,1 ; 1, start of draw
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; DRAW WINDOW
|
|
||||||
mov eax,0 ; function 0 : define and draw window
|
|
||||||
mov ebx,320*65536+(LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2+98
|
|
||||||
mov ecx,25*65536+ (LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION+4
|
|
||||||
mov edx,0x03000000 ; color of work area RRGGBB
|
|
||||||
mov esi,0x006688ee ; color of grab bar RRGGBB,8->col
|
|
||||||
mov edi,0x007799ff ; color of frames RRGGBB
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; WINDOW LABEL
|
|
||||||
mov eax,4 ; function 4 : write text to window
|
|
||||||
mov ebx,8*65536+5 ; [x start] *65536 + [y start]
|
|
||||||
mov ecx,0x00ffffff ; color of text RRGGBB
|
|
||||||
mov edx,labelt ; pointer to text beginning
|
|
||||||
mov esi,scoretext-labelt ; text length
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
cmp byte[status],'0'
|
|
||||||
jne status1
|
|
||||||
call draw_logo
|
|
||||||
call draw_menu
|
|
||||||
|
|
||||||
status1:
|
|
||||||
cmp byte[status],'1'
|
|
||||||
jne status2
|
|
||||||
|
|
||||||
call draw_game
|
|
||||||
|
|
||||||
status2:
|
|
||||||
cmp byte[status],'2'
|
|
||||||
jne status3
|
|
||||||
|
|
||||||
call draw_game
|
|
||||||
|
|
||||||
mov eax,4 ; function 4 : write text to window
|
|
||||||
mov ebx,80*65536+170 ; [x start] *65536 + [y start]
|
|
||||||
mov ecx,0x10ff0000 ; color of text RRGGBB
|
|
||||||
mov edx,paused ; pointer to text beginning
|
|
||||||
mov esi,txt_end-paused ; text length
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
status3:
|
|
||||||
cmp byte[status],'3'
|
|
||||||
jne status4
|
|
||||||
|
|
||||||
call draw_logo
|
|
||||||
mov edx,history
|
|
||||||
call show_text
|
|
||||||
|
|
||||||
status4:
|
|
||||||
cmp byte[status],'4'
|
|
||||||
jne status5
|
|
||||||
|
|
||||||
call draw_logo
|
|
||||||
mov edx,instructions
|
|
||||||
call show_text
|
|
||||||
|
|
||||||
status5:
|
|
||||||
|
|
||||||
mov eax,12 ; function 12:tell os about windowdraw
|
|
||||||
mov ebx,2 ; 2, end of draw
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
draw_game:
|
|
||||||
|
|
||||||
call draw_table
|
|
||||||
movzx edx,byte [current_block_color]
|
|
||||||
call draw_block
|
|
||||||
|
|
||||||
call write_score
|
|
||||||
|
|
||||||
mov eax,38
|
|
||||||
mov ebx,((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2-4) shl 16 + ((LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2-4)
|
|
||||||
mov ecx,20 shl 16 + ((LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION+2-4)
|
|
||||||
mov edx,0x00ffffff
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
draw_logo:
|
|
||||||
|
|
||||||
mov ebx,2
|
|
||||||
mov ecx,2
|
|
||||||
mov edx,[color_table+1*4]
|
|
||||||
mov edi,tetris_t
|
|
||||||
call draw_title_block
|
|
||||||
mov ebx,5
|
|
||||||
mov ecx,3
|
|
||||||
mov edx,[color_table+2*4]
|
|
||||||
mov edi,tetris_e
|
|
||||||
call draw_title_block
|
|
||||||
mov ebx,8
|
|
||||||
mov ecx,2
|
|
||||||
mov edx,[color_table+3*4]
|
|
||||||
mov edi,tetris_t
|
|
||||||
call draw_title_block
|
|
||||||
mov ebx,11
|
|
||||||
mov ecx,3
|
|
||||||
mov edx,[color_table+4*4]
|
|
||||||
mov edi,tetris_r
|
|
||||||
call draw_title_block
|
|
||||||
mov ebx,13
|
|
||||||
mov ecx,2
|
|
||||||
mov edx,[color_table+5*4]
|
|
||||||
mov edi,tetris_i
|
|
||||||
call draw_title_block
|
|
||||||
mov ebx,15
|
|
||||||
mov ecx,3
|
|
||||||
mov edx,[color_table+6*4]
|
|
||||||
mov edi,tetris_s
|
|
||||||
call draw_title_block
|
|
||||||
mov ebx,20
|
|
||||||
mov ecx,2
|
|
||||||
mov edx,[color_table+7*4]
|
|
||||||
mov edi,tetris_II
|
|
||||||
call draw_title_block
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
show_text:
|
|
||||||
mov ebx,6*65536+120 ; draw info text with function 4
|
|
||||||
mov ecx,0xff0000
|
|
||||||
mov esi,34
|
|
||||||
newline:
|
|
||||||
mov eax,4
|
|
||||||
int 0x40
|
|
||||||
add ebx,10
|
|
||||||
add edx,34
|
|
||||||
cmp [edx],byte 'x'
|
|
||||||
jne newline
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
@@ -16,14 +16,15 @@ use32
|
|||||||
|
|
||||||
org 0x0
|
org 0x0
|
||||||
|
|
||||||
db 'MENUET00' ; 8 byte id
|
db 'MENUET01' ; 8 byte id
|
||||||
dd 38 ; required os
|
dd 1 ; header version
|
||||||
dd START ; program start
|
dd START ; program start
|
||||||
dd I_END ; program image size
|
dd I_END ; program image size
|
||||||
dd 0x100000 ; required amount of memory
|
dd mem ; required amount of memory
|
||||||
dd 0x00000000 ; reserved=no extended header
|
dd mem ; stack pointer
|
||||||
|
dd 0, 0 ; param, icon
|
||||||
include 'lang.inc'
|
|
||||||
|
include 'lang.inc'
|
||||||
include 'macros.inc'
|
include 'macros.inc'
|
||||||
|
|
||||||
START: ; start of execution
|
START: ; start of execution
|
||||||
@@ -36,38 +37,30 @@ START: ; start of execution
|
|||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov [socketNum], eax
|
mov [socketNum], eax
|
||||||
|
|
||||||
|
red:
|
||||||
call draw_window ; at first, draw the window
|
call draw_window ; at first, draw the window
|
||||||
|
|
||||||
still:
|
still:
|
||||||
|
|
||||||
mov eax,23 ; wait here for event
|
mov eax,10 ; wait here for event
|
||||||
mov ebx,1
|
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
cmp eax,1 ; redraw request ?
|
dec eax
|
||||||
jz red
|
jz red
|
||||||
cmp eax,2 ; key in buffer ?
|
dec eax
|
||||||
jz key
|
jnz button
|
||||||
cmp eax,3 ; button in buffer ?
|
|
||||||
jz button
|
|
||||||
|
|
||||||
jmp still
|
|
||||||
|
|
||||||
red:
|
|
||||||
call draw_window
|
|
||||||
jmp still
|
|
||||||
|
|
||||||
key:
|
key:
|
||||||
mov eax,2
|
mov al,2
|
||||||
int 0x40
|
int 0x40
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
button:
|
button:
|
||||||
mov eax,17
|
mov al,17
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
cmp ah,1 ; button id=1 ?
|
dec ah ; button id=1 ?
|
||||||
jnz noclose
|
jnz noclose
|
||||||
mov eax, 53
|
mov eax, 53
|
||||||
mov ebx, 1
|
mov ebx, 1
|
||||||
@@ -76,14 +69,8 @@ button:
|
|||||||
mov eax,-1
|
mov eax,-1
|
||||||
int 0x40
|
int 0x40
|
||||||
noclose:
|
noclose:
|
||||||
|
; it was not close button, so it must be send code button
|
||||||
cmp ah,2 ; SEND CODE ?
|
|
||||||
je send_xcode
|
|
||||||
|
|
||||||
|
|
||||||
jmp still
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; SEND CODE TO REMOTE ;;
|
;; SEND CODE TO REMOTE ;;
|
||||||
@@ -92,19 +79,13 @@ button:
|
|||||||
|
|
||||||
send_xcode:
|
send_xcode:
|
||||||
|
|
||||||
mov esi,send_data ; header
|
|
||||||
mov edi,I_END
|
|
||||||
mov ecx,end_message-send_data
|
|
||||||
cld
|
|
||||||
rep movsb
|
|
||||||
|
|
||||||
mov eax,53 ; SEND CODE TO REMOTE
|
mov eax,53 ; SEND CODE TO REMOTE
|
||||||
mov ebx,4
|
mov ebx,4
|
||||||
mov ecx,[socketNum]
|
mov ecx,[socketNum]
|
||||||
mov edx,end_message-send_data
|
mov edx,end_message-send_data
|
||||||
mov esi,I_END
|
mov esi,send_data
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
|
|
||||||
@@ -124,8 +105,6 @@ draw_window:
|
|||||||
mov ebx,100*65536+250 ; [x start] *65536 + [x size]
|
mov ebx,100*65536+250 ; [x start] *65536 + [x size]
|
||||||
mov ecx,60*65536+150 ; [y start] *65536 + [y size]
|
mov ecx,60*65536+150 ; [y start] *65536 + [y size]
|
||||||
mov edx,0x03ffffff ; color of work area RRGGBB
|
mov edx,0x03ffffff ; color of work area RRGGBB
|
||||||
mov esi,0x80aabbcc ; color of grab bar RRGGBB,8->color gl
|
|
||||||
mov edi,0x00aabbcc ; color of frames RRGGBB
|
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
; WINDOW LABEL
|
; WINDOW LABEL
|
||||||
@@ -143,7 +122,6 @@ draw_window:
|
|||||||
mov esi,0x667788
|
mov esi,0x667788
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
cld
|
|
||||||
mov ebx,25*65536+50 ; draw info text with function 4
|
mov ebx,25*65536+50 ; draw info text with function 4
|
||||||
mov ecx,0x000000
|
mov ecx,0x000000
|
||||||
mov edx,text
|
mov edx,text
|
||||||
@@ -152,7 +130,7 @@ draw_window:
|
|||||||
mov eax,4
|
mov eax,4
|
||||||
int 0x40
|
int 0x40
|
||||||
add ebx,16
|
add ebx,16
|
||||||
add edx,40
|
add edx,esi
|
||||||
cmp [edx],byte 'x'
|
cmp [edx],byte 'x'
|
||||||
jnz newline
|
jnz newline
|
||||||
|
|
||||||
@@ -165,34 +143,38 @@ draw_window:
|
|||||||
|
|
||||||
; DATA AREA
|
; DATA AREA
|
||||||
|
|
||||||
|
if lang eq ru
|
||||||
text:
|
text:
|
||||||
db ' <20><><EFBFBD><E1ABA0> ᮮ<>饭<EFBFBD><E9A5AD> '
|
db ' <20><><EFBFBD><E1ABA0> ᮮ<>饭<EFBFBD><E9A5AD> '
|
||||||
db ' '
|
db ' '
|
||||||
db ' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> : 192.168.0.1 '
|
db ' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> : 192.168.0.1 '
|
||||||
db ' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> : 192.168.0.2 '
|
db ' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> : 192.168.0.2 '
|
||||||
db '<27><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>室<EFBFBD><E5AEA4><EFBFBD><EFBFBD> '
|
db '<27><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>室<EFBFBD><E5AEA4><EFBFBD><EFBFBD> '
|
||||||
db 'x <- END MARKER, DONT DELETE '
|
db 'x' ; <- END MARKER, DONT DELETE
|
||||||
|
else
|
||||||
|
text:
|
||||||
|
db ' Send message '
|
||||||
|
db ' '
|
||||||
|
db ' Local address : 192.168.0.1 '
|
||||||
|
db ' Remote address : 192.168.0.2 '
|
||||||
|
db 'Text and address in end of source '
|
||||||
|
db 'x' ; <- END MARKER, DONT DELETE
|
||||||
|
end if
|
||||||
|
|
||||||
labeltext: db 'NetSend(Client)' ;
|
labeltext: db 'NetSend(Client)' ;
|
||||||
lte:
|
lte:
|
||||||
|
|
||||||
socketNum dd 0x0
|
|
||||||
|
|
||||||
remote_ip db 192,168,1,2
|
remote_ip db 192,168,1,2
|
||||||
|
|
||||||
picture_position dd 0x0
|
|
||||||
|
|
||||||
send_data db '<27>ਢ<EFBFBD><E0A8A2>,<2C><><EFBFBD> <20><><EFBFBD><EFBFBD>!Hello,this is a test!'
|
send_data db '<27>ਢ<EFBFBD><E0A8A2>,<2C><><EFBFBD> <20><><EFBFBD><EFBFBD>!Hello,this is a test!'
|
||||||
end_message:
|
end_message:
|
||||||
|
|
||||||
|
|
||||||
I_END:
|
I_END:
|
||||||
|
align 4
|
||||||
|
socketNum dd ?
|
||||||
|
|
||||||
|
rb 32 ; this is for stack
|
||||||
|
|
||||||
|
mem:
|
||||||
|
|
||||||
|
@@ -183,13 +183,19 @@ draw_window:
|
|||||||
|
|
||||||
; DATA AREA
|
; DATA AREA
|
||||||
|
|
||||||
|
if lang eq ru
|
||||||
text:
|
text:
|
||||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> : 192.168.0.2 '
|
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> : 192.168.0.2 '
|
||||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> : 0x5000 '
|
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> : 0x5000 '
|
||||||
db '<27><><EFBFBD><EFBFBD><E1ABA0><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD>: '
|
db '<27><><EFBFBD><EFBFBD><E1ABA0><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD>: '
|
||||||
db 'x <- END MARKER, DONT DELETE '
|
db 'x' ; <- END MARKER, DONT DELETE
|
||||||
|
else
|
||||||
|
text:
|
||||||
|
db 'This address : 192.168.0.2 '
|
||||||
|
db 'Used port : 0x5000 '
|
||||||
|
db 'Received messages: '
|
||||||
|
db 'x' ; <- END MARKER, DONT DELETE
|
||||||
|
end if
|
||||||
|
|
||||||
labeltext: db 'NetSend(Server)'
|
labeltext: db 'NetSend(Server)'
|
||||||
lte:
|
lte:
|
||||||
@@ -198,10 +204,3 @@ socketNum dd 0x0
|
|||||||
|
|
||||||
|
|
||||||
I_END:
|
I_END:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@@ -1,4 +1,4 @@
|
|||||||
; @RCHER - DEflate unpacker v1.0
|
; @RCHER - Deflate unpacker v2.0 beta
|
||||||
;
|
;
|
||||||
; Written in pure assembler by Ivushkin Andrey aka Willow
|
; Written in pure assembler by Ivushkin Andrey aka Willow
|
||||||
;
|
;
|
||||||
@@ -8,15 +8,17 @@
|
|||||||
;
|
;
|
||||||
; Compile with FASM
|
; Compile with FASM
|
||||||
|
|
||||||
|
|
||||||
SYS equ meos
|
SYS equ meos
|
||||||
PARAM_PTR equ png_image
|
OUTBUF equ 4*1024*1024
|
||||||
|
png_imag = output+OUTBUF
|
||||||
|
PARAM_PTR = os_work;png_image
|
||||||
|
MEMINIT=next_code;output
|
||||||
DUMPFILE equ '/hd/1/out.txt'
|
DUMPFILE equ '/hd/1/out.txt'
|
||||||
|
|
||||||
SHOW_RBLOCK equ 0;1
|
SHOW_RBLOCK equ 0;1
|
||||||
SHOW_PNG_SEC equ 0;1
|
SHOW_PNG_SEC equ 0;1
|
||||||
SHOW_METH equ 0;1
|
SHOW_METH equ 0;1
|
||||||
FILE_NUM equ 0
|
FILE_NUM equ 15;8
|
||||||
MEMORY equ 0x800000
|
MEMORY equ 0x800000
|
||||||
|
|
||||||
BITS equ 16
|
BITS equ 16
|
||||||
@@ -28,7 +30,6 @@ NO_STOPS equ 1
|
|||||||
SHOW_CHARS equ 0
|
SHOW_CHARS equ 0
|
||||||
BSIZE equ 512
|
BSIZE equ 512
|
||||||
INBUF equ BUFSIZE*BSIZE*2
|
INBUF equ BUFSIZE*BSIZE*2
|
||||||
OUTBUF equ 4*1024*1024
|
|
||||||
IGNORE_DIRS equ 0
|
IGNORE_DIRS equ 0
|
||||||
|
|
||||||
MOVE_SLINE_LEV equ 8
|
MOVE_SLINE_LEV equ 8
|
||||||
@@ -40,6 +41,9 @@ STAY_MODE equ 10000b
|
|||||||
IPC_MODE equ 100000b
|
IPC_MODE equ 100000b
|
||||||
RAW_MODE equ 1000000b
|
RAW_MODE equ 1000000b
|
||||||
THREAD_YES equ 10000000b
|
THREAD_YES equ 10000000b
|
||||||
|
LIST_MODE equ 100000000b
|
||||||
|
MEM_MODE equ 1000000000b
|
||||||
|
FIND_MODE equ 10000000000b
|
||||||
|
|
||||||
if SYS eq win
|
if SYS eq win
|
||||||
format PE console
|
format PE console
|
||||||
@@ -57,34 +61,36 @@ use32
|
|||||||
dd 0x01
|
dd 0x01
|
||||||
dd start
|
dd start
|
||||||
dd I_END
|
dd I_END
|
||||||
dd MEMORY
|
dd MEMINIT
|
||||||
dd MEMORY-2048
|
dd main_stack;MEMORY-2048
|
||||||
if PARAM_PTR eq param
|
if PARAM_PTR eq param
|
||||||
dd 0
|
dd 0
|
||||||
else
|
else
|
||||||
dd PARAM_PTR
|
dd PARAM_PTR
|
||||||
end if
|
end if
|
||||||
dd 0x0
|
dd 0x0
|
||||||
include "lang.inc"
|
|
||||||
|
|
||||||
if PARAM_PTR eq param
|
if PARAM_PTR eq param
|
||||||
param db 'RQ'
|
param db 'N'
|
||||||
db '000037'
|
db '000015'
|
||||||
db '/hd/1/zip/png.zip',0
|
db '/hd/1/zip/gz/fasm-1~1.tgz',0
|
||||||
end if
|
end if
|
||||||
;match =meos,SYS
|
;match =meos,SYS
|
||||||
;{
|
;{
|
||||||
include "macros.inc"
|
include "macros.inc"
|
||||||
; purge mov
|
; purge mov
|
||||||
include "debug.inc"
|
include "debug.inc"
|
||||||
|
include 'dump.inc'
|
||||||
;}
|
;}
|
||||||
end if
|
end if
|
||||||
|
|
||||||
language equ en
|
include 'lang.inc'
|
||||||
|
language equ lang
|
||||||
|
|
||||||
if SYS eq win
|
if SYS eq win
|
||||||
section '.text' code readable executable writeable
|
section '.text' code readable executable writeable
|
||||||
end if
|
end if
|
||||||
|
|
||||||
include "arcmacro.inc"
|
include "arcmacro.inc"
|
||||||
include "parser.inc"
|
include "parser.inc"
|
||||||
include "deflate.inc"
|
include "deflate.inc"
|
||||||
@@ -107,6 +113,12 @@ else
|
|||||||
mcall 40,10000101b
|
mcall 40,10000101b
|
||||||
; jmp again
|
; jmp again
|
||||||
CmdLine
|
CmdLine
|
||||||
|
cmdl:
|
||||||
|
test [Flags],LIST_MODE
|
||||||
|
jz red
|
||||||
|
|
||||||
|
; Dump [lpath],[lpath_len],os_work
|
||||||
|
; ud2
|
||||||
red:
|
red:
|
||||||
call draw_window
|
call draw_window
|
||||||
mcall 12,2
|
mcall 12,2
|
||||||
@@ -134,12 +146,15 @@ else
|
|||||||
mcall -1
|
mcall -1
|
||||||
.noquit:
|
.noquit:
|
||||||
mcall 17
|
mcall 17
|
||||||
|
mcall 64,1,MEMINIT
|
||||||
QueryFile
|
QueryFile
|
||||||
and [FileNum],0
|
mov [FileNum],FILE_NUM
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jnz still
|
jnz still
|
||||||
end if
|
end if
|
||||||
again:
|
again:
|
||||||
|
; Dump Flags,4,os_work
|
||||||
|
mov [fat_],fat
|
||||||
Newline
|
Newline
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
; and [Flags],STAY_MODE
|
; and [Flags],STAY_MODE
|
||||||
@@ -153,6 +168,11 @@ again:
|
|||||||
Msg 14
|
Msg 14
|
||||||
jmp quit
|
jmp quit
|
||||||
.sizeok2:
|
.sizeok2:
|
||||||
|
call KillViewer
|
||||||
|
xor eax,eax
|
||||||
|
mov ecx,(child_stack-fat)/4
|
||||||
|
mov edi,fat
|
||||||
|
rep stosd
|
||||||
mov [filesize],ebx
|
mov [filesize],ebx
|
||||||
test [Flags],RAW_MODE
|
test [Flags],RAW_MODE
|
||||||
jz .norawm
|
jz .norawm
|
||||||
@@ -213,13 +233,37 @@ again:
|
|||||||
jmp exit
|
jmp exit
|
||||||
.sizeok1:
|
.sizeok1:
|
||||||
if ~ SYS eq win
|
if ~ SYS eq win
|
||||||
call KillViewer
|
|
||||||
end if
|
end if
|
||||||
Msg 39
|
Msg 39 ; unpacking PNG
|
||||||
|
mov ecx,[unp_size]
|
||||||
|
add ecx,output
|
||||||
|
mov [png_],ecx
|
||||||
|
mov eax,[PNG_info.Width]
|
||||||
|
imul eax,[PNG_info.Height]
|
||||||
|
lea eax,[eax+eax*2]
|
||||||
|
add ecx,eax
|
||||||
|
; dps 'Mem='
|
||||||
|
; dpd ecx
|
||||||
|
mcall 64,1
|
||||||
|
test eax,eax
|
||||||
|
jz .ok
|
||||||
|
Msg 41
|
||||||
|
jmp exit
|
||||||
|
.ok:
|
||||||
mov edi,[outp]
|
mov edi,[outp]
|
||||||
call Deflate.blkbegin
|
call Deflate.blkbegin
|
||||||
jmp .defl_end
|
jmp .defl_end
|
||||||
.sizeok:
|
.sizeok:
|
||||||
|
mov ecx,[unp_size]
|
||||||
|
dpd ecx
|
||||||
|
add ecx,output
|
||||||
|
; mov [png_],ecx
|
||||||
|
mcall 64,1
|
||||||
|
test eax,eax
|
||||||
|
jz .ok2
|
||||||
|
Msg 41
|
||||||
|
jmp exit
|
||||||
|
.ok2:
|
||||||
call Deflate ; <===========
|
call Deflate ; <===========
|
||||||
.defl_end:
|
.defl_end:
|
||||||
test [bits],7
|
test [bits],7
|
||||||
@@ -252,6 +296,8 @@ again:
|
|||||||
pop ecx esi
|
pop ecx esi
|
||||||
jmp .skipAdler
|
jmp .skipAdler
|
||||||
.skipCRC:
|
.skipCRC:
|
||||||
|
; dps 'Out='
|
||||||
|
; dpd ecx
|
||||||
call UAdler
|
call UAdler
|
||||||
Msg 10
|
Msg 10
|
||||||
mov eax,[Adler32]
|
mov eax,[Adler32]
|
||||||
@@ -283,15 +329,20 @@ if SYS eq win
|
|||||||
else
|
else
|
||||||
test [Flags],PNG_MODE
|
test [Flags],PNG_MODE
|
||||||
jnz .nosave
|
jnz .nosave
|
||||||
|
test [Flags],LIST_MODE
|
||||||
|
jnz quit
|
||||||
|
|
||||||
test [Flags],TAR_MODE
|
test [Flags],TAR_MODE
|
||||||
jnz .nomsg
|
jnz .nomsg
|
||||||
Msg 37
|
Msg 37
|
||||||
.nomsg:
|
.nomsg:
|
||||||
mov [outfile.out],ebx
|
mov [outfile.out],ebx
|
||||||
mcall 58,outfile
|
mcall 58,outfile
|
||||||
|
; dps 'Before Quit1'
|
||||||
|
; ud2
|
||||||
test [Flags],TAR_MODE
|
test [Flags],TAR_MODE
|
||||||
jnz .nosave
|
jz exit.pad
|
||||||
call StartPad
|
; call StartPad
|
||||||
.nosave:
|
.nosave:
|
||||||
end if
|
end if
|
||||||
test [Flags],PNG_MODE
|
test [Flags],PNG_MODE
|
||||||
@@ -300,7 +351,7 @@ end if
|
|||||||
mov edi,filters
|
mov edi,filters
|
||||||
mov ecx,6
|
mov ecx,6
|
||||||
rep stosd
|
rep stosd
|
||||||
mov edi,png_image
|
mov edi,[png_]
|
||||||
mov esi,output
|
mov esi,output
|
||||||
;//
|
;//
|
||||||
mov [outp],edi
|
mov [outp],edi
|
||||||
@@ -310,34 +361,37 @@ end if
|
|||||||
mov [outfile.size],edi
|
mov [outfile.size],edi
|
||||||
mov ebx,[outp];png_image
|
mov ebx,[outp];png_image
|
||||||
if SYS eq win
|
if SYS eq win
|
||||||
exit:
|
exit:
|
||||||
Msg 12
|
Msg 12
|
||||||
invoke CreateFile,outfile,GENERIC_WRITE, FILE_SHARE_WRITE, NULL, \
|
invoke CreateFile,outfile,GENERIC_WRITE, FILE_SHARE_WRITE, NULL, \
|
||||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,NULL
|
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,NULL
|
||||||
mov [hnd],eax
|
mov [hnd],eax
|
||||||
invoke WriteFile, eax,ebx,[outfile.size],cparam1,NULL
|
invoke WriteFile, eax,ebx,[outfile.size],cparam1,NULL
|
||||||
invoke CloseHandle, [hnd]
|
invoke CloseHandle, [hnd]
|
||||||
call RunViewer
|
call RunViewer
|
||||||
and [arc_base],0
|
and [arc_base],0
|
||||||
and [Flags],STAY_MODE
|
and [Flags],STAY_MODE
|
||||||
|
; dps 'Before Quit2'
|
||||||
quit:
|
quit:
|
||||||
QueryFile
|
QueryFile
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jnz again
|
jnz again
|
||||||
invoke ExitProcess,0
|
invoke ExitProcess,0
|
||||||
else
|
else
|
||||||
exit:
|
exit:
|
||||||
mov [outfile.out],ebx
|
mov [outfile.out],ebx
|
||||||
test [Flags],TAR_MODE
|
test [Flags],TAR_MODE
|
||||||
jz .notar
|
jz .notar
|
||||||
Msg 37
|
Msg 37
|
||||||
|
test [Flags],LIST_MODE
|
||||||
|
jne quit
|
||||||
mcall 58,outfile
|
mcall 58,outfile
|
||||||
|
.pad:
|
||||||
call StartPad
|
call StartPad
|
||||||
.notar:
|
.notar:
|
||||||
Msg 12
|
Msg 12
|
||||||
call RunViewer
|
call RunViewer
|
||||||
and [arc_base],0
|
and [arc_base],0
|
||||||
and [Flags],STAY_MODE
|
and [Flags],STAY_MODE
|
||||||
quit:
|
quit:
|
||||||
test [Flags],STAY_MODE
|
test [Flags],STAY_MODE
|
||||||
@@ -352,16 +406,19 @@ NoPng:
|
|||||||
else
|
else
|
||||||
jz still
|
jz still
|
||||||
end if
|
end if
|
||||||
mov ecx,dumpf_len
|
; Dump output,255,os_work
|
||||||
mov esi,dumpfile
|
; ud2
|
||||||
mov edi,filename
|
; mov ecx,dumpf_len
|
||||||
rep movsb
|
; mov esi,dumpfile
|
||||||
call OpenFile
|
; mov edi,filename
|
||||||
test ebx,ebx
|
; rep movsb
|
||||||
jz again.sizebadq
|
; call OpenFile
|
||||||
|
; test ebx,ebx
|
||||||
|
; jz again.sizebadq
|
||||||
call TarParse
|
call TarParse
|
||||||
mov ecx,[FileNum]
|
mov ecx,[FileNum]
|
||||||
call TarFindN
|
call TarFindN
|
||||||
|
; dpd [outfile.size]
|
||||||
cmp [outfile.size],0
|
cmp [outfile.size],0
|
||||||
jz again.sizebadq
|
jz again.sizebadq
|
||||||
mov ebx,esi
|
mov ebx,esi
|
||||||
@@ -397,22 +454,22 @@ section '.idata' import data readable writeable
|
|||||||
WriteFile,'WriteFile',\
|
WriteFile,'WriteFile',\
|
||||||
SetFilePointer,'SetFilePointer',\
|
SetFilePointer,'SetFilePointer',\
|
||||||
CloseHandle,'CloseHandle',\
|
CloseHandle,'CloseHandle',\
|
||||||
GetStdHandle,'GetStdHandle',\
|
GetStdHandle,'GetStdHandle',\
|
||||||
WriteConsole,'WriteConsoleA',\
|
WriteConsole,'WriteConsoleA',\
|
||||||
ReadConsole,'ReadConsoleA',\
|
ReadConsole,'ReadConsoleA',\
|
||||||
CreateProcess,'CreateProcessA',\
|
CreateProcess,'CreateProcessA',\
|
||||||
WritePrivateProfileString,'WritePrivateProfileStringA',\
|
WritePrivateProfileString,'WritePrivateProfileStringA',\
|
||||||
ExitProcess,'ExitProcess'
|
ExitProcess,'ExitProcess'
|
||||||
|
|
||||||
import comdlg,\
|
import comdlg,\
|
||||||
GetOpenFileName,'GetOpenFileNameA'
|
GetOpenFileName,'GetOpenFileNameA'
|
||||||
|
|
||||||
import user,\
|
import user,\
|
||||||
wsprintf,'wsprintfA',\
|
wsprintf,'wsprintfA',\
|
||||||
SendMessage,'SendMessageA',\
|
SendMessage,'SendMessageA',\
|
||||||
FindWindowEx,'FindWindowExA',\
|
FindWindowEx,'FindWindowExA',\
|
||||||
WaitForInputIdle,'WaitForInputIdle'
|
WaitForInputIdle,'WaitForInputIdle'
|
||||||
|
|
||||||
|
|
||||||
section '.reloc' fixups data readable discardable
|
section '.reloc' fixups data readable discardable
|
||||||
end if
|
end if
|
||||||
|
@@ -177,7 +177,7 @@ str_table \
|
|||||||
' ',\ ;38
|
' ',\ ;38
|
||||||
<'<27><><EFBFBD><EFBFBD><EFBFBD>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>...',13,10>,\ ;39
|
<'<27><><EFBFBD><EFBFBD><EFBFBD>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>...',13,10>,\ ;39
|
||||||
<'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "R" <20><><EFBFBD> <20><>ࠡ<EFBFBD>⪨ <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>⬥<EFBFBD><E2ACA5>.',13,10>,\ ;40
|
<'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "R" <20><><EFBFBD> <20><>ࠡ<EFBFBD>⪨ <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>⬥<EFBFBD><E2ACA5>.',13,10>,\ ;40
|
||||||
' ',\ ;
|
<'<27><> 墠⠥<E5A2A0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! <20>⬥<EFBFBD><E2ACA5>.',13,10>,\ ; 41
|
||||||
' ',\ ;
|
' ',\ ;
|
||||||
' ',\ ;
|
' ',\ ;
|
||||||
' ',\ ;
|
' ',\ ;
|
||||||
@@ -232,7 +232,7 @@ str_table \
|
|||||||
' ',\ ;38
|
' ',\ ;38
|
||||||
<'Preparing bitmap...',13,10>,\ ;39
|
<'Preparing bitmap...',13,10>,\ ;39
|
||||||
<'Specify "R" to force raw data. Abort.',13,10>,\ ;40
|
<'Specify "R" to force raw data. Abort.',13,10>,\ ;40
|
||||||
' ',\ ;
|
<'Not enough memory! Abort.',13,10>,\ ;
|
||||||
' ',\ ;
|
' ',\ ;
|
||||||
' ',\ ;
|
' ',\ ;
|
||||||
' ',\ ;
|
' ',\ ;
|
||||||
|
@@ -61,7 +61,7 @@ db 'png\absolut0.png',0
|
|||||||
else
|
else
|
||||||
if ~ FNAME eq
|
if ~ FNAME eq
|
||||||
db FNAME
|
db FNAME
|
||||||
end if
|
end if
|
||||||
; db '/hd/1/zip/png.zip',0
|
; db '/hd/1/zip/png.zip',0
|
||||||
; db '/hd/1/zip/files/opossum.png'
|
; db '/hd/1/zip/files/opossum.png'
|
||||||
; db '/rd/1/www.zip',0
|
; db '/rd/1/www.zip',0
|
||||||
@@ -84,6 +84,11 @@ DKeys rd 3
|
|||||||
Dheader rb 12
|
Dheader rb 12
|
||||||
Dpassword rb PASSW_LEN
|
Dpassword rb PASSW_LEN
|
||||||
|
|
||||||
|
png_ dd ?
|
||||||
|
fat_ dd ?
|
||||||
|
fat_fnum dd ?
|
||||||
|
lpath dd ?
|
||||||
|
lpath_len dd ?
|
||||||
png_bpp dd ?
|
png_bpp dd ?
|
||||||
sline_len dd ?
|
sline_len dd ?
|
||||||
IDATcount dd ?
|
IDATcount dd ?
|
||||||
@@ -120,6 +125,15 @@ tblLen dw ?
|
|||||||
hclen db ?
|
hclen db ?
|
||||||
max_len dw ?
|
max_len dw ?
|
||||||
|
|
||||||
|
fat:
|
||||||
|
rb 4096;512
|
||||||
|
child_stack:
|
||||||
|
rb 1024
|
||||||
|
main_stack:
|
||||||
|
area:
|
||||||
|
rb INBUF
|
||||||
|
os_work rb 4*1024
|
||||||
|
|
||||||
bl_count rb BITS
|
bl_count rb BITS
|
||||||
|
|
||||||
next_code rw BITS
|
next_code rw BITS
|
||||||
@@ -143,16 +157,10 @@ hdist db ?
|
|||||||
Distance rw 32
|
Distance rw 32
|
||||||
Dist_c rw 32
|
Dist_c rw 32
|
||||||
|
|
||||||
|
|
||||||
area:
|
|
||||||
rb INBUF
|
|
||||||
|
|
||||||
os_work rb 4*1024
|
|
||||||
|
|
||||||
output:
|
output:
|
||||||
rb OUTBUF
|
;rb OUTBUF
|
||||||
|
|
||||||
png_image:
|
;png_image:
|
||||||
if SYS eq win
|
if SYS eq win
|
||||||
rb OUTBUF
|
rb OUTBUF
|
||||||
end if
|
end if
|
||||||
|
@@ -73,10 +73,16 @@ debug_outstr:
|
|||||||
@@:
|
@@:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
_debug_crlf db 13, 10, 0
|
||||||
|
|
||||||
macro newline
|
macro newline
|
||||||
{
|
{
|
||||||
dps <13,10>
|
pushf
|
||||||
|
pushad
|
||||||
|
mov edx, _debug_crlf
|
||||||
|
call debug_outstr
|
||||||
|
popad
|
||||||
|
popf
|
||||||
}
|
}
|
||||||
|
|
||||||
macro print message
|
macro print message
|
||||||
|
@@ -113,7 +113,7 @@ end if
|
|||||||
jb .no81
|
jb .no81
|
||||||
add eax,0x58
|
add eax,0x58
|
||||||
jmp .noend
|
jmp .noend
|
||||||
.no81:
|
.no81:
|
||||||
sub eax,0x30
|
sub eax,0x30
|
||||||
stosb
|
stosb
|
||||||
jmp .next
|
jmp .next
|
||||||
@@ -128,7 +128,7 @@ if SHOW_METH eq 1
|
|||||||
end if
|
end if
|
||||||
pusha
|
pusha
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
mov ecx,(area-bl_count) / 4
|
mov ecx,(output-bl_count) / 4
|
||||||
mov edi,bl_count
|
mov edi,bl_count
|
||||||
rep stosd
|
rep stosd
|
||||||
popa
|
popa
|
||||||
|
55
programs/other/archer/trunk/dump.inc
Normal file
55
programs/other/archer/trunk/dump.inc
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
; Include file for dumping user apps' memory through new debug BOARD
|
||||||
|
|
||||||
|
; Max amount of bytes to be dumped
|
||||||
|
IPC_BUF equ 160
|
||||||
|
|
||||||
|
; Dump macro parameters:
|
||||||
|
; ptr - pointer to memory dumped
|
||||||
|
; len - dump length
|
||||||
|
; workarea - any work area for sysfunc 9
|
||||||
|
; run_new - if not empty, run BOARD unless it is running already
|
||||||
|
|
||||||
|
macro Dump ptr, len, workarea,run_new
|
||||||
|
{
|
||||||
|
local .exist,.lt
|
||||||
|
pusha
|
||||||
|
mov ebx,workarea
|
||||||
|
call Board_seek
|
||||||
|
if ~ run_new eq
|
||||||
|
test edx,edx
|
||||||
|
jne .exist
|
||||||
|
mcall 19,Board_seek.board_fn,0
|
||||||
|
mov edx,eax
|
||||||
|
mcall 5,20
|
||||||
|
end if
|
||||||
|
.exist:
|
||||||
|
mov esi,len
|
||||||
|
cmp esi,IPC_BUF
|
||||||
|
jbe .lt
|
||||||
|
mov esi,IPC_BUF
|
||||||
|
.lt:
|
||||||
|
mcall 60,2,edx,ptr
|
||||||
|
popa
|
||||||
|
}
|
||||||
|
|
||||||
|
if used Board_seek
|
||||||
|
Board_seek:
|
||||||
|
; ebx - prcinfo
|
||||||
|
xor edx,edx
|
||||||
|
mcall 9,,-1
|
||||||
|
mov ecx,eax
|
||||||
|
mov esi,dword[.board_fn]
|
||||||
|
.lp:
|
||||||
|
mcall 9
|
||||||
|
cmp dword[ebx+10],esi
|
||||||
|
; jne .no
|
||||||
|
; cmp dword[ebx+42],399
|
||||||
|
je .ok
|
||||||
|
.no:
|
||||||
|
loop .lp
|
||||||
|
ret
|
||||||
|
.ok:
|
||||||
|
mov edx,[ebx+30]
|
||||||
|
ret
|
||||||
|
.board_fn db 'BOARD '
|
||||||
|
end if
|
@@ -143,9 +143,6 @@ macro mcall a,b,c,d,e,f { ; mike.dld
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; optimize the code for size
|
; optimize the code for size
|
||||||
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
||||||
|
|
||||||
@@ -177,7 +174,7 @@ macro sub arg1,arg2
|
|||||||
|
|
||||||
macro mov arg1,arg2
|
macro mov arg1,arg2
|
||||||
{
|
{
|
||||||
if (arg1 in __regs) & (arg2 eqtype 0)
|
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
|
||||||
if (arg2) = 0
|
if (arg2) = 0
|
||||||
xor arg1,arg1
|
xor arg1,arg1
|
||||||
else if (arg2) = 1
|
else if (arg2) = 1
|
||||||
|
@@ -22,11 +22,85 @@ PrintFilename:
|
|||||||
rep movsb
|
rep movsb
|
||||||
mov dword[edi],0x00a0d
|
mov dword[edi],0x00a0d
|
||||||
call DebugPrint
|
call DebugPrint
|
||||||
; mcall 10
|
popa
|
||||||
; mcall 2
|
call Add2Fat
|
||||||
|
ret
|
||||||
|
|
||||||
|
Add2Fat:
|
||||||
|
; edx - ptr, ecx - len
|
||||||
|
|
||||||
|
pusha
|
||||||
|
test [Flags],LIST_MODE
|
||||||
|
jz .ex
|
||||||
|
mov ebp,8
|
||||||
|
mov edi,edx
|
||||||
|
lea ebx,[edx+ecx]
|
||||||
|
mov ecx,[lpath_len]
|
||||||
|
cmp ecx,1
|
||||||
|
je .lbl
|
||||||
|
mov esi,[lpath]
|
||||||
|
repe cmpsb
|
||||||
|
jne .full
|
||||||
|
mov eax,[lpath_len]
|
||||||
|
sub dword[esp+24],eax;path_len-path
|
||||||
|
cmp edi,ebx
|
||||||
|
je .full
|
||||||
|
mov edx,edi
|
||||||
|
.lbl:
|
||||||
|
mov ecx,[esp+24]
|
||||||
|
mov al,'/'
|
||||||
|
repne scasb
|
||||||
|
mov eax,[fat_]
|
||||||
|
mov ecx,[esp+24]
|
||||||
|
jne .nofol
|
||||||
|
cmp edi,ebx
|
||||||
|
jne .full
|
||||||
|
lea ecx,[edi-1]
|
||||||
|
sub ecx,edx
|
||||||
|
or byte[eax+11],0x10
|
||||||
|
; sub edx,ecx
|
||||||
|
.nofol:
|
||||||
|
|
||||||
|
push [fat_fnum]
|
||||||
|
pop dword[eax+12]
|
||||||
|
mov edi,eax
|
||||||
|
mov esi,edx
|
||||||
|
.lp1:
|
||||||
|
|
||||||
|
mov bl,[esi]
|
||||||
|
lea edx,[eax+ebp]
|
||||||
|
inc esi
|
||||||
|
cmp bl,'.'
|
||||||
|
jne .nodot
|
||||||
|
lea edi,[eax+ebp]
|
||||||
|
mov ebp,11
|
||||||
|
jmp .ll
|
||||||
|
.nodot:
|
||||||
|
cmp edi,edx
|
||||||
|
jae .ll
|
||||||
|
mov [edi],bl
|
||||||
|
inc edi
|
||||||
|
.ll:
|
||||||
|
loop .lp1
|
||||||
|
mov ecx,11
|
||||||
|
dec eax
|
||||||
|
.lp2:
|
||||||
|
cmp byte[eax+ecx],0
|
||||||
|
jne .no0
|
||||||
|
mov byte[eax+ecx],' '
|
||||||
|
.no0:
|
||||||
|
loop .lp2
|
||||||
|
cmp eax,child_stack-1
|
||||||
|
jae .full
|
||||||
|
add [fat_],32
|
||||||
|
.full:
|
||||||
|
inc [fat_fnum]
|
||||||
|
.ex:
|
||||||
popa
|
popa
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
;path db '/';'fasm/examples/elfexe/'
|
||||||
|
;path_len:
|
||||||
|
|
||||||
; Parse routines:
|
; Parse routines:
|
||||||
; out: edx= 0 if all ok, 1 - central dir, 2-EOD
|
; out: edx= 0 if all ok, 1 - central dir, 2-EOD
|
||||||
@@ -78,16 +152,19 @@ end if
|
|||||||
popa
|
popa
|
||||||
end if
|
end if
|
||||||
Newline
|
Newline
|
||||||
|
; Dump fat,160,os_work
|
||||||
ret
|
ret
|
||||||
|
|
||||||
ZipFindN:
|
ZipFindN:
|
||||||
; ecx - file #
|
; ecx - file #
|
||||||
Msg 33
|
Msg 33
|
||||||
|
or [Flags],FIND_MODE
|
||||||
cmp ecx,[file_count]
|
cmp ecx,[file_count]
|
||||||
jae .err
|
jae .err
|
||||||
push ecx
|
push ecx
|
||||||
call ResetFile
|
call ResetFile
|
||||||
.nxt:
|
.nxt:
|
||||||
|
|
||||||
call ZipCrawl
|
call ZipCrawl
|
||||||
cmp edx,51
|
cmp edx,51
|
||||||
je .ok2
|
je .ok2
|
||||||
@@ -111,6 +188,7 @@ ZipFindN:
|
|||||||
add esi,eax
|
add esi,eax
|
||||||
mov edx,5
|
mov edx,5
|
||||||
.ex:
|
.ex:
|
||||||
|
and [Flags],-1-FIND_MODE
|
||||||
push edx
|
push edx
|
||||||
Msg edx
|
Msg edx
|
||||||
pop edx
|
pop edx
|
||||||
@@ -159,6 +237,8 @@ if IGNORE_DIRS eq 1
|
|||||||
cmp byte[edx+ecx-1],'/'
|
cmp byte[edx+ecx-1],'/'
|
||||||
je .skipdp
|
je .skipdp
|
||||||
end if
|
end if
|
||||||
|
test [Flags],FIND_MODE
|
||||||
|
jnz .skipdp
|
||||||
call PrintFilename
|
call PrintFilename
|
||||||
.skipdp:
|
.skipdp:
|
||||||
movzx ecx,word[esi+28]
|
movzx ecx,word[esi+28]
|
||||||
@@ -252,7 +332,19 @@ PngParse:
|
|||||||
mov [PNG_info.Width],eax
|
mov [PNG_info.Width],eax
|
||||||
mov eax,[PNG_info.Height]
|
mov eax,[PNG_info.Height]
|
||||||
bswap eax
|
bswap eax
|
||||||
|
mov ebx,eax
|
||||||
mov [PNG_info.Height],eax
|
mov [PNG_info.Height],eax
|
||||||
|
call scanline_calc
|
||||||
|
; dps 'All='
|
||||||
|
cmp [PNG_info.Color_type],3
|
||||||
|
jne .nopal
|
||||||
|
shl eax,3
|
||||||
|
inc eax
|
||||||
|
.nopal:
|
||||||
|
inc eax
|
||||||
|
imul eax,ebx
|
||||||
|
mov [unp_size],eax
|
||||||
|
; dpd eax
|
||||||
add esi,25
|
add esi,25
|
||||||
cmp byte[esi-5],0
|
cmp byte[esi-5],0
|
||||||
rep_err e,52,29
|
rep_err e,52,29
|
||||||
@@ -423,7 +515,8 @@ setcurb:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
TarParse:
|
TarParse:
|
||||||
call ResetFile
|
mov esi,output
|
||||||
|
; call ResetFile
|
||||||
.nxt:
|
.nxt:
|
||||||
call TarCrawl
|
call TarCrawl
|
||||||
; wait
|
; wait
|
||||||
@@ -436,8 +529,9 @@ end if
|
|||||||
inc [file_count]
|
inc [file_count]
|
||||||
.skipinc:
|
.skipinc:
|
||||||
add eax,ecx
|
add eax,ecx
|
||||||
mov ebx,1
|
; mov ebx,1
|
||||||
call FileSeek
|
add esi,eax
|
||||||
|
; call FileSeek
|
||||||
jmp .nxt
|
jmp .nxt
|
||||||
|
|
||||||
TarFindN:
|
TarFindN:
|
||||||
@@ -447,7 +541,8 @@ TarFindN:
|
|||||||
cmp ecx,[file_count]
|
cmp ecx,[file_count]
|
||||||
jae .err
|
jae .err
|
||||||
push ecx
|
push ecx
|
||||||
call ResetFile
|
mov esi,output
|
||||||
|
; call ResetFile
|
||||||
.nxt:
|
.nxt:
|
||||||
call TarCrawl
|
call TarCrawl
|
||||||
if IGNORE_DIRS eq 1
|
if IGNORE_DIRS eq 1
|
||||||
@@ -461,8 +556,9 @@ end if
|
|||||||
dec dword[esp]
|
dec dword[esp]
|
||||||
.seek:
|
.seek:
|
||||||
add eax,ecx
|
add eax,ecx
|
||||||
mov ebx,1
|
; mov ebx,1
|
||||||
call FileSeek
|
add esi,eax
|
||||||
|
; call FileSeek
|
||||||
jmp .nxt
|
jmp .nxt
|
||||||
.err:
|
.err:
|
||||||
mov edx,4
|
mov edx,4
|
||||||
@@ -559,13 +655,8 @@ SfxParse:
|
|||||||
.err:
|
.err:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; Created: May 31, 2005
|
scanline_calc:
|
||||||
FiltCall:
|
movzx ecx,byte[PNG_info.Color_type]
|
||||||
dd PngFilter.nofilt,Filt_sub,Filt_up,Filt_av,Filt_paeth,PngFilter.nofilt
|
|
||||||
PngFilter:
|
|
||||||
; esi - filtered uncompressed image data
|
|
||||||
; edi - destination
|
|
||||||
mov cl,[PNG_info.Color_type]
|
|
||||||
mov eax,1
|
mov eax,1
|
||||||
cmp cl,3
|
cmp cl,3
|
||||||
je .palette
|
je .palette
|
||||||
@@ -594,6 +685,15 @@ PngFilter:
|
|||||||
jnz .noz2
|
jnz .noz2
|
||||||
inc eax
|
inc eax
|
||||||
.noz2:
|
.noz2:
|
||||||
|
ret
|
||||||
|
|
||||||
|
; Created: May 31, 2005
|
||||||
|
FiltCall:
|
||||||
|
dd PngFilter.nofilt,Filt_sub,Filt_up,Filt_av,Filt_paeth,PngFilter.nofilt
|
||||||
|
PngFilter:
|
||||||
|
; esi - filtered uncompressed image data
|
||||||
|
; edi - destination
|
||||||
|
call scanline_calc
|
||||||
mov [sline_len],eax ; scanline length
|
mov [sline_len],eax ; scanline length
|
||||||
push edi
|
push edi
|
||||||
and [Flags],not 1
|
and [Flags],not 1
|
||||||
|
@@ -105,7 +105,7 @@ RunViewer:
|
|||||||
else
|
else
|
||||||
test [Flags],THREAD_YES
|
test [Flags],THREAD_YES
|
||||||
jnz .ex
|
jnz .ex
|
||||||
mcall 51,1,thread,MEMORY
|
mcall 51,1,thread,child_stack;MEMORY
|
||||||
mov [child],eax
|
mov [child],eax
|
||||||
end if
|
end if
|
||||||
.ex:
|
.ex:
|
||||||
@@ -191,7 +191,7 @@ thread:
|
|||||||
mov ecx,[PNG_info.Width]
|
mov ecx,[PNG_info.Width]
|
||||||
shl ecx,16
|
shl ecx,16
|
||||||
add ecx,[PNG_info.Height]
|
add ecx,[PNG_info.Height]
|
||||||
mcall 7,png_image,,10 shl 16+25
|
mcall 7,[png_],,10 shl 16+25
|
||||||
mcall 12,2
|
mcall 12,2
|
||||||
.still:
|
.still:
|
||||||
mcall 10
|
mcall 10
|
||||||
@@ -208,6 +208,7 @@ thread:
|
|||||||
jne .still
|
jne .still
|
||||||
.close:
|
.close:
|
||||||
and [child],0
|
and [child],0
|
||||||
|
mcall 64,1,MEMINIT
|
||||||
mcall -1
|
mcall -1
|
||||||
|
|
||||||
KillViewer:
|
KillViewer:
|
||||||
@@ -256,7 +257,68 @@ macro CmdLine
|
|||||||
mov ecx,255
|
mov ecx,255
|
||||||
mov edi,filename
|
mov edi,filename
|
||||||
rep movsb
|
rep movsb
|
||||||
jmp again
|
; test [Flags],LIST_MODE
|
||||||
|
; jz again
|
||||||
|
xor eax,eax
|
||||||
|
mov edi,filename
|
||||||
|
mov ecx,255
|
||||||
|
repne scasb
|
||||||
|
cmp byte[edi-2],'/'
|
||||||
|
je .slash
|
||||||
|
mov byte[edi-1],'/'
|
||||||
|
inc edi
|
||||||
|
.slash:
|
||||||
|
; Dump filename,255,os_work
|
||||||
|
; ud2
|
||||||
|
mov ecx,edi
|
||||||
|
; dec ecx
|
||||||
|
mov edx,ecx
|
||||||
|
mov dword[Finfo],13
|
||||||
|
; mov dword[Finfo.count],1
|
||||||
|
mov edi,filename+5
|
||||||
|
sub ecx,edi
|
||||||
|
.lp:
|
||||||
|
mov al,'/'
|
||||||
|
repne scasb
|
||||||
|
; jne .ex
|
||||||
|
; dpd ecx
|
||||||
|
and byte[edi-1],0
|
||||||
|
mcall 58,Finfo
|
||||||
|
mov byte[edi-1],'/'
|
||||||
|
test ebx,32
|
||||||
|
jz .lp
|
||||||
|
test [Flags],LIST_MODE
|
||||||
|
jne .listm
|
||||||
|
and byte[edi-1],0
|
||||||
|
; Dump filename,255,os_work
|
||||||
|
jmp .agg
|
||||||
|
; ud2
|
||||||
|
.listm:
|
||||||
|
lea esi,[edi-1+ecx]
|
||||||
|
lea edi,[esi+1]
|
||||||
|
std
|
||||||
|
rep movsb
|
||||||
|
and byte[edi],0
|
||||||
|
cld
|
||||||
|
; dpd filename
|
||||||
|
|
||||||
|
inc edi
|
||||||
|
dpd edi
|
||||||
|
cmp edx,edi
|
||||||
|
jne .slash2
|
||||||
|
; cmp byte[edi],'/'
|
||||||
|
; je .slash2
|
||||||
|
mov byte[edi],'/'
|
||||||
|
inc edx
|
||||||
|
.slash2:
|
||||||
|
sub edx,edi
|
||||||
|
mov [lpath],edi
|
||||||
|
mov [lpath_len],edx
|
||||||
|
dpd edx
|
||||||
|
.agg:
|
||||||
|
mov dword[Finfo],0
|
||||||
|
; ud2
|
||||||
|
jmp again;cmdl
|
||||||
.yespar:
|
.yespar:
|
||||||
cmp al,'N'
|
cmp al,'N'
|
||||||
jne .nonum
|
jne .nonum
|
||||||
@@ -291,7 +353,7 @@ macro CmdLine
|
|||||||
cmp al,'q'
|
cmp al,'q'
|
||||||
jne .noofs
|
jne .noofs
|
||||||
lodsd
|
lodsd
|
||||||
.fofs:
|
.fofs:
|
||||||
mov [arc_base],eax
|
mov [arc_base],eax
|
||||||
jmp .parse
|
jmp .parse
|
||||||
.noofs:
|
.noofs:
|
||||||
@@ -299,7 +361,11 @@ macro CmdLine
|
|||||||
jne .noofs2
|
jne .noofs2
|
||||||
call get_6ASCII_num
|
call get_6ASCII_num
|
||||||
jmp .fofs
|
jmp .fofs
|
||||||
.noofs2:
|
.noofs2:
|
||||||
|
cmp al,'L'
|
||||||
|
jne .nolist
|
||||||
|
or [Flags],LIST_MODE
|
||||||
|
.nolist:
|
||||||
jmp .parse
|
jmp .parse
|
||||||
|
|
||||||
get_6ASCII_num:
|
get_6ASCII_num:
|
||||||
@@ -319,8 +385,20 @@ get_6ASCII_num:
|
|||||||
}
|
}
|
||||||
|
|
||||||
StartPad:
|
StartPad:
|
||||||
mcall 19,editorcmd,dumpfile
|
; mcall 19,editorcmd,dumpfile
|
||||||
|
pusha
|
||||||
|
mov esi,[outfile.size]
|
||||||
|
; dpd esi
|
||||||
|
mov [par_fsize],esi
|
||||||
|
mcall 19,editorcmd,editor_par
|
||||||
|
mov ecx,eax
|
||||||
|
mcall 5,20
|
||||||
|
mcall 60,2,,[outfile.out];output
|
||||||
|
mcall 64,1,MEMINIT
|
||||||
|
popa
|
||||||
ret
|
ret
|
||||||
|
|
||||||
editorcmd db 'TINYPAD '
|
editorcmd db 'TINYPAD '
|
||||||
|
editor_par db '*'
|
||||||
|
par_fsize dd ?
|
||||||
end if
|
end if
|
@@ -5,9 +5,16 @@
|
|||||||
;
|
;
|
||||||
; Compile with FASM for Menuet
|
; Compile with FASM for Menuet
|
||||||
;
|
;
|
||||||
|
LMARGIN equ (15+5)
|
||||||
|
TMARGIN equ (35+5)
|
||||||
|
HSPACE equ 16
|
||||||
|
VSPACE equ 12
|
||||||
|
IPC_BUF equ 160
|
||||||
|
DR_GRID equ 0;1
|
||||||
|
|
||||||
|
FL_KRNL equ 1
|
||||||
|
|
||||||
include 'lang.inc'
|
include 'lang.inc'
|
||||||
include 'macros.inc'
|
|
||||||
|
|
||||||
use32
|
use32
|
||||||
org 0x0
|
org 0x0
|
||||||
@@ -15,18 +22,20 @@ include 'macros.inc'
|
|||||||
dd 0x01 ; header version
|
dd 0x01 ; header version
|
||||||
dd START ; start of code
|
dd START ; start of code
|
||||||
dd I_END ; size of image
|
dd I_END ; size of image
|
||||||
dd 0x2000 ; memory for app (4 Kb)
|
dd i_end+0x2000 ; memory for app (4 Kb)
|
||||||
dd 0x2000 ; esp
|
dd i_end+0x2000 ; esp
|
||||||
dd 0x0 , 0x0 ; I_Param , I_Icon
|
dd 0x0 , 0x0 ; I_Param , I_Icon
|
||||||
|
include 'MACROS.INC'
|
||||||
|
include 'debug.inc'
|
||||||
|
purge newline
|
||||||
MAXSTRINGS = 16
|
MAXSTRINGS = 16
|
||||||
|
TMP = 80*(MAXSTRINGS+1)
|
||||||
xpos dd 0x0
|
|
||||||
ypos dd 0
|
|
||||||
|
|
||||||
|
|
||||||
START: ; start of execution
|
START: ; start of execution
|
||||||
|
|
||||||
|
mcall 60,1,ipcbuff,IPC_BUF+20
|
||||||
|
mcall 40,1000111b
|
||||||
|
mov [ipcbuff+4],8
|
||||||
mov ecx,1024
|
mov ecx,1024
|
||||||
flush:
|
flush:
|
||||||
mov eax,63
|
mov eax,63
|
||||||
@@ -34,20 +43,21 @@ START: ; start of execution
|
|||||||
int 0x40
|
int 0x40
|
||||||
loop flush
|
loop flush
|
||||||
|
|
||||||
mov ecx, 80*(MAXSTRINGS+1)
|
mov ecx, TMP
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
mov edi, text
|
mov edi, [targ]
|
||||||
rep stosb
|
rep stosb
|
||||||
|
|
||||||
mov [tmp],'x'
|
mov [tmp1],'x'
|
||||||
|
mov [tmp2],'x'
|
||||||
|
|
||||||
mov eax,14
|
mov eax,14
|
||||||
int 0x40
|
int 0x40
|
||||||
and eax,0xffff0000
|
and eax,0xffff0000
|
||||||
sub eax,400 shl 16
|
sub eax,399 shl 16
|
||||||
add eax,400
|
add eax,399
|
||||||
mov [xstart],eax
|
mov [xstart],eax
|
||||||
|
red:
|
||||||
call draw_window
|
call draw_window
|
||||||
|
|
||||||
still:
|
still:
|
||||||
@@ -62,53 +72,70 @@ still:
|
|||||||
je key
|
je key
|
||||||
cmp eax,3 ; button in buffer ?
|
cmp eax,3 ; button in buffer ?
|
||||||
je button
|
je button
|
||||||
|
cmp eax,7
|
||||||
|
je ipc
|
||||||
mov eax,63
|
mov eax,63
|
||||||
mov ebx,2
|
mov ebx,2
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
cmp ebx,1
|
cmp ebx,1
|
||||||
jne still
|
jne still
|
||||||
|
|
||||||
new_data:
|
new_data:
|
||||||
|
mov ebp,[targ]
|
||||||
|
.no4:
|
||||||
cmp al,13
|
cmp al,13
|
||||||
jne no13
|
jne no13
|
||||||
mov [xpos],0
|
and dword[ebp-8],0
|
||||||
jmp new_check
|
jmp new_check
|
||||||
no13:
|
no13:
|
||||||
cmp al,10
|
cmp al,10
|
||||||
jne no10
|
jne no10
|
||||||
inc [ypos]
|
inc dword[ebp-4]
|
||||||
cmp [ypos],MAXSTRINGS
|
cmp dword[ebp-4],MAXSTRINGS
|
||||||
jbe noypos
|
jbe .noypos
|
||||||
mov [ypos],MAXSTRINGS
|
mov dword[ebp-4],MAXSTRINGS
|
||||||
mov esi,text+80
|
lea esi,[ebp+80]
|
||||||
mov edi,text
|
mov edi,ebp
|
||||||
mov ecx,80*(MAXSTRINGS)
|
mov ecx,80*(MAXSTRINGS)
|
||||||
cld
|
cld
|
||||||
rep movsb
|
rep movsb
|
||||||
|
|
||||||
mov esi,[ypos]
|
mov esi,[ebp-4]
|
||||||
imul esi,80
|
imul esi,80
|
||||||
add esi,[xpos]
|
add esi,[ebp-8]
|
||||||
add esi,text
|
add esi,ebp
|
||||||
mov ecx,80
|
mov ecx,80
|
||||||
xor al,al
|
xor al,al
|
||||||
rep stosb
|
rep stosb
|
||||||
noypos:
|
.noypos:
|
||||||
|
mov [targ],text2
|
||||||
|
and [krnl_cnt],0
|
||||||
jmp new_check
|
jmp new_check
|
||||||
no10:
|
no10:
|
||||||
|
cmp ebp,text1
|
||||||
mov esi,[ypos]
|
je add2
|
||||||
imul esi,80
|
mov ecx,[krnl_cnt]
|
||||||
add esi,[xpos]
|
cmp al,[krnl_msg+ecx]
|
||||||
mov [text+esi],al
|
jne .noknl
|
||||||
inc [xpos]
|
inc [krnl_cnt]
|
||||||
cmp [xpos],80
|
cmp [krnl_cnt],4
|
||||||
jb xposok
|
jne new_check
|
||||||
mov [xpos],79
|
mov [targ],text1
|
||||||
xposok:
|
.noknl:
|
||||||
|
mov ebp,[targ]
|
||||||
|
jecxz .add
|
||||||
|
push eax
|
||||||
|
mov esi,krnl_msg
|
||||||
|
.l1:
|
||||||
|
lodsb
|
||||||
|
call add_char
|
||||||
|
loop .l1
|
||||||
|
pop eax
|
||||||
|
.add:
|
||||||
|
and [krnl_cnt],0
|
||||||
|
add2:
|
||||||
|
call add_char
|
||||||
|
|
||||||
new_check:
|
new_check:
|
||||||
|
|
||||||
@@ -119,35 +146,126 @@ still:
|
|||||||
cmp ebx,1
|
cmp ebx,1
|
||||||
je new_data
|
je new_data
|
||||||
|
|
||||||
|
cmp [vmode],2
|
||||||
|
je still
|
||||||
call draw_window
|
call draw_window
|
||||||
|
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
|
ipc:
|
||||||
red: ; redraw
|
mov [vmode],2
|
||||||
call draw_window
|
mov eax,ipcbuff
|
||||||
jmp still
|
mov esi,[eax+8]
|
||||||
|
mov byte[eax],1
|
||||||
|
push dword[eax+12]
|
||||||
|
pop [dump_len]
|
||||||
|
mcall 9,work,-1
|
||||||
|
mov ecx,eax
|
||||||
|
.lp:
|
||||||
|
mcall 9
|
||||||
|
cmp [ebx+30],esi
|
||||||
|
je .ok
|
||||||
|
loop .lp
|
||||||
|
and [dump_len],0
|
||||||
|
jmp red
|
||||||
|
.ok:
|
||||||
|
mov [pid],esi
|
||||||
|
lea esi,[ebx+10]
|
||||||
|
mov edi,dump_title+10
|
||||||
|
mov ecx,12
|
||||||
|
rep movsb
|
||||||
|
jmp red
|
||||||
key: ; key
|
key: ; key
|
||||||
mov eax,2 ; just read it and ignore
|
mov eax,2 ; just read it and ignore
|
||||||
int 0x40
|
int 0x40
|
||||||
|
cmp ah,' '
|
||||||
|
je button.no_krnl_flt
|
||||||
|
cmp [vmode],2
|
||||||
|
jne still
|
||||||
|
cmp ah,176 ;left
|
||||||
|
jb still
|
||||||
|
cmp ah,179 ;right
|
||||||
|
ja still
|
||||||
|
mov ecx,[offs]
|
||||||
|
shr eax,8
|
||||||
|
sub eax,176
|
||||||
|
add ecx,[arrows+eax*4]
|
||||||
|
shl ecx,12
|
||||||
|
shr cx,12
|
||||||
|
jmp button.check_sel
|
||||||
|
.nol:
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
|
arrows dd -1,16,-16,1
|
||||||
|
|
||||||
button: ; button
|
button: ; button
|
||||||
mov eax,17 ; get id
|
mov eax,17 ; get id
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
cmp ah,1 ; button id=1 ?
|
cmp ah,1 ; button id=1 ?
|
||||||
jne noclose
|
jne .noclose
|
||||||
|
|
||||||
mov eax,-1 ; close this program
|
mov eax,-1 ; close this program
|
||||||
int 0x40
|
int 0x40
|
||||||
noclose:
|
.noclose:
|
||||||
|
shr eax,8
|
||||||
|
cmp eax,10
|
||||||
|
jb .nodump
|
||||||
|
lea edi,[eax-10]
|
||||||
|
mcall 37,1
|
||||||
|
sub eax,[edi*4+dump_cell_marg]
|
||||||
|
sub eax,TMARGIN+VSPACE
|
||||||
|
push eax
|
||||||
|
and eax,0xffff
|
||||||
|
xor edx,edx
|
||||||
|
div word[edi*4+dump_cell_size+2]
|
||||||
|
mov ecx,eax
|
||||||
|
shl ecx,16
|
||||||
|
xor edx,edx
|
||||||
|
pop eax
|
||||||
|
shr eax,16
|
||||||
|
div word[edi*4+dump_cell_size]
|
||||||
|
mov cx,ax
|
||||||
|
.check_sel:
|
||||||
|
mov eax,ecx
|
||||||
|
shl ax,12
|
||||||
|
shr eax,12
|
||||||
|
inc eax
|
||||||
|
cmp eax,[dump_len]
|
||||||
|
ja still;.nosel
|
||||||
|
mov dword[sel_byte],ecx
|
||||||
|
dec eax
|
||||||
|
mov [offs],eax
|
||||||
|
jmp red
|
||||||
|
|
||||||
|
.nodump:
|
||||||
|
cmp eax,2
|
||||||
|
jne .no_krnl_flt
|
||||||
|
xor [flag],FL_KRNL
|
||||||
jmp still
|
jmp still
|
||||||
|
.no_krnl_flt:
|
||||||
|
mov [ipcbuff+4],8
|
||||||
|
and byte[ipcbuff],0
|
||||||
|
inc [vmode]
|
||||||
|
cmp [vmode],3
|
||||||
|
jb .vmok
|
||||||
|
and [vmode],0
|
||||||
|
.vmok:
|
||||||
|
jmp red
|
||||||
|
|
||||||
|
add_char:
|
||||||
|
push esi
|
||||||
|
mov esi,[ebp-4]
|
||||||
|
imul esi,80
|
||||||
|
add esi,[ebp-8]
|
||||||
|
mov [ebp+esi],al
|
||||||
|
inc dword[ebp-8]
|
||||||
|
cmp dword[ebp-8],80
|
||||||
|
jb .ok
|
||||||
|
mov dword[ebp-8],79
|
||||||
|
.ok:
|
||||||
|
pop esi
|
||||||
|
ret
|
||||||
|
|
||||||
; *********************************************
|
; *********************************************
|
||||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||||
@@ -170,7 +288,7 @@ draw_window:
|
|||||||
mov eax,0 ; function 0 : define and draw window
|
mov eax,0 ; function 0 : define and draw window
|
||||||
; mov ebx,50*65536+400 ; [x start] *65536 + [x size]
|
; mov ebx,50*65536+400 ; [x start] *65536 + [x size]
|
||||||
mov ebx,[xstart]
|
mov ebx,[xstart]
|
||||||
mov ecx,MAXSTRINGS*10+40 ; [y start] *65536 + [y size]
|
mov ecx,MAXSTRINGS*10+45 ; [y start] *65536 + [y size]
|
||||||
mov edx,[sc.work] ; color of work area RRGGBB,8->color gl
|
mov edx,[sc.work] ; color of work area RRGGBB,8->color gl
|
||||||
or edx,0x03000000
|
or edx,0x03000000
|
||||||
int 0x40
|
int 0x40
|
||||||
@@ -184,9 +302,24 @@ draw_window:
|
|||||||
mov esi,header.len ; text length
|
mov esi,header.len ; text length
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
|
mov ecx,4
|
||||||
|
mov esi,[sc.work]
|
||||||
|
mov ebx,316 shl 16+5*6
|
||||||
|
mov edx,3;+1 shl 30
|
||||||
|
mcall 8,,<5,12>
|
||||||
|
mov edx,[vmode]
|
||||||
|
lea edx,[edx*4+duk]
|
||||||
|
mcall 4,<320,8>,,,4
|
||||||
|
|
||||||
|
cmp [vmode],2
|
||||||
|
je no_mdbg
|
||||||
mov ebx,15*65536+33 ; draw info text with function 4
|
mov ebx,15*65536+33 ; draw info text with function 4
|
||||||
mov ecx,[sc.work_text]
|
mov ecx,[sc.work_text]
|
||||||
mov edx,text
|
mov edx,text1
|
||||||
|
cmp [vmode],0
|
||||||
|
je .kern
|
||||||
|
mov edx,text2
|
||||||
|
.kern:
|
||||||
mov esi,80
|
mov esi,80
|
||||||
newline:
|
newline:
|
||||||
mov eax,4
|
mov eax,4
|
||||||
@@ -195,16 +328,199 @@ draw_window:
|
|||||||
add edx,80
|
add edx,80
|
||||||
cmp [edx],byte 'x'
|
cmp [edx],byte 'x'
|
||||||
jne newline
|
jne newline
|
||||||
|
jmp enddraw
|
||||||
|
no_mdbg:
|
||||||
|
if DUMP_TEST eq 1
|
||||||
|
mov esi,0
|
||||||
|
mov [dump_len],100;IPC_BUF
|
||||||
|
else
|
||||||
|
mov esi,ipcbuff+16
|
||||||
|
end if
|
||||||
|
mov ecx,[dump_len]
|
||||||
|
call dump_btn
|
||||||
|
call draw_dump
|
||||||
|
enddraw:
|
||||||
mov eax,12 ; function 12:tell os about windowdraw
|
mov eax,12 ; function 12:tell os about windowdraw
|
||||||
mov ebx,2 ; 2, end of draw
|
mov ebx,2 ; 2, end of draw
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
if DR_GRID eq 1
|
||||||
|
draw_grid:
|
||||||
|
mov ecx,11
|
||||||
|
mov edi,(TMARGIN+VSPACE)shl 16+TMARGIN+VSPACE
|
||||||
|
.l1:
|
||||||
|
push ecx
|
||||||
|
mov ebx,LMARGIN shl 16+LMARGIN+16*HSPACE
|
||||||
|
mcall 38,,edi,0
|
||||||
|
add edi,VSPACE shl 16+VSPACE
|
||||||
|
pop ecx
|
||||||
|
loop .l1
|
||||||
|
mov ecx,17
|
||||||
|
mov edi,(TMARGIN+VSPACE)shl 16+TMARGIN+VSPACE*10
|
||||||
|
mov ebx,LMARGIN shl 16+LMARGIN
|
||||||
|
.l2:
|
||||||
|
push ecx
|
||||||
|
mcall 38,,edi,0
|
||||||
|
add ebx,HSPACE shl 16+HSPACE
|
||||||
|
pop ecx
|
||||||
|
loop .l2
|
||||||
|
ret
|
||||||
|
end if
|
||||||
|
|
||||||
|
draw_numbers:
|
||||||
|
mcall 4,(LMARGIN+2) shl 16+180,0,numb,numb_len-numb
|
||||||
|
mov eax,dword[sel_byte]
|
||||||
|
shl ax,12
|
||||||
|
shr eax,12
|
||||||
|
mov edi,eax
|
||||||
|
if ~ DUMP_TEST eq 1
|
||||||
|
add edi,ipcbuff+16
|
||||||
|
end if
|
||||||
|
mov edx,(LMARGIN+2+6*6)shl 16+180
|
||||||
|
mov ebx,0x30000
|
||||||
|
movzx ecx,byte[edi]
|
||||||
|
mcall 47,,,,0x4e00e7
|
||||||
|
add ebx,0x20000
|
||||||
|
add edx,(6*10)shl 16
|
||||||
|
movzx ecx,word[edi]
|
||||||
|
mcall
|
||||||
|
add ebx,0x50000
|
||||||
|
add edx,(6*13)shl 16
|
||||||
|
mov ecx,[edi]
|
||||||
|
mcall
|
||||||
|
mov ebx,0x80100
|
||||||
|
add edx,(6*19)shl 16
|
||||||
|
mcall
|
||||||
|
.ex:
|
||||||
|
ret
|
||||||
|
|
||||||
|
draw_dump:
|
||||||
|
; esi - data ptr, ecx - length
|
||||||
|
jecxz draw_numbers.ex
|
||||||
|
pusha
|
||||||
|
call draw_numbers
|
||||||
|
mcall 4,(LMARGIN+2) shl 16+27,0,dump_title,dump_t_len-dump_title
|
||||||
|
mcall 47,0x30101,ipcbuff+8,(LMARGIN+2+6*29)shl 16+27
|
||||||
|
add edx,(6*27) shl 16
|
||||||
|
mov ecx,offs
|
||||||
|
mcall
|
||||||
|
sub edx,(5*6)shl 16
|
||||||
|
mcall ,0x30001
|
||||||
|
mov ecx,16
|
||||||
|
mov edi,HSPACE shl 16
|
||||||
|
mov ebx,(LMARGIN+5)shl 16+42
|
||||||
|
call draw_marks
|
||||||
|
mov ecx,[esp+24]
|
||||||
|
dec ecx
|
||||||
|
shr ecx,4
|
||||||
|
inc ecx
|
||||||
|
mov ebx,(LMARGIN-10)shl 16+TMARGIN+2+VSPACE
|
||||||
|
mov edi,VSPACE
|
||||||
|
call draw_marks
|
||||||
|
popa
|
||||||
|
mov edx,TMARGIN+2
|
||||||
|
mov edi,ecx
|
||||||
|
.lp:
|
||||||
|
add edx,(LMARGIN+2) shl 16+VSPACE
|
||||||
|
mov ecx,16
|
||||||
|
cmp edi,ecx
|
||||||
|
jae .less
|
||||||
|
mov ecx,edi
|
||||||
|
.less:
|
||||||
|
sub edi,ecx
|
||||||
|
push esi ecx
|
||||||
|
mov ebx,0x20100
|
||||||
|
.lp1:
|
||||||
|
push ecx esi
|
||||||
|
movzx ecx,byte[esi]
|
||||||
|
mcall 47,,,,0
|
||||||
|
add edx,HSPACE shl 16
|
||||||
|
pop esi ecx
|
||||||
|
inc esi
|
||||||
|
loop .lp1
|
||||||
|
pusha
|
||||||
|
mov ebx,edx
|
||||||
|
and ebx,0xffff
|
||||||
|
add ebx,(LMARGIN+16*HSPACE+15)shl 16
|
||||||
|
mov edx,[esp+36]
|
||||||
|
mov esi,[esp+32]
|
||||||
|
mcall 4,,0
|
||||||
|
popa
|
||||||
|
add esp,8
|
||||||
|
and edx,0xffff
|
||||||
|
test edi,edi
|
||||||
|
jnz .lp
|
||||||
|
.ex:
|
||||||
|
ret
|
||||||
|
|
||||||
|
draw_marks:
|
||||||
|
; ebx -xy, edi-addition, ecx -cycles
|
||||||
|
pusha
|
||||||
|
mov edx,__hexdigits
|
||||||
|
mov eax,4
|
||||||
|
mov esi,1
|
||||||
|
.tt:
|
||||||
|
push ecx
|
||||||
|
mcall ,,0xffffff
|
||||||
|
add ebx,edi
|
||||||
|
inc edx
|
||||||
|
pop ecx
|
||||||
|
loop .tt
|
||||||
|
popa
|
||||||
|
ret
|
||||||
|
|
||||||
|
dump_btn: ; ecx-length
|
||||||
|
jecxz draw_dump.ex
|
||||||
|
pusha
|
||||||
|
test ecx,0xffff
|
||||||
|
je .even
|
||||||
|
add ecx,16
|
||||||
|
.even:
|
||||||
|
shr ecx,4
|
||||||
|
imul ecx,VSPACE
|
||||||
|
add ecx,(TMARGIN+VSPACE)shl 16-5
|
||||||
|
mcall 8,LMARGIN shl 16+16*HSPACE-5,,10+3 shl 29,[sc.work]
|
||||||
|
inc edx
|
||||||
|
mcall ,(LMARGIN+16*HSPACE+15)shl 16+6*16
|
||||||
|
mov edx,0xff0000
|
||||||
|
mov esi,dump_cell_size
|
||||||
|
xor eax,eax
|
||||||
|
movzx ebx,[sel_byte]
|
||||||
|
lodsw
|
||||||
|
imul bx,ax
|
||||||
|
shl ebx,16
|
||||||
|
lea ebx,[ebx+eax+LMARGIN shl 16]
|
||||||
|
movzx ecx,[sel_byte+2]
|
||||||
|
lodsw
|
||||||
|
imul cx,ax
|
||||||
|
shl ecx,16
|
||||||
|
lea ecx,[ecx+eax+(TMARGIN+VSPACE) shl 16]
|
||||||
|
mcall 13
|
||||||
|
movzx ebx,[sel_byte]
|
||||||
|
lodsw
|
||||||
|
imul bx,ax
|
||||||
|
shl ebx,16
|
||||||
|
lea ebx,[ebx+eax+(LMARGIN+16*HSPACE+15)shl 16]
|
||||||
|
mcall 13
|
||||||
|
popa
|
||||||
|
.ex:
|
||||||
|
ret
|
||||||
|
|
||||||
|
krnl_msg db 'K : '
|
||||||
|
duk db 'KernUserDump'
|
||||||
|
numb db 'Byte: Word: Dword: Hex:'
|
||||||
|
numb_len:
|
||||||
|
dump_title db 'Dump from (pid= h) Offset: ( h)'
|
||||||
|
dump_t_len:
|
||||||
|
|
||||||
; DATA AREA
|
; DATA AREA
|
||||||
|
|
||||||
|
dump_cell_marg dd LMARGIN shl 16,(LMARGIN+16*HSPACE+15)shl 16
|
||||||
|
dump_cell_size dw HSPACE,VSPACE,6,VSPACE
|
||||||
|
; 11,11 > 0,-1
|
||||||
|
; 5,11 > 0,-1
|
||||||
if lang eq ru
|
if lang eq ru
|
||||||
header:
|
header:
|
||||||
db '<27><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
db '<27><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||||
@@ -214,8 +530,27 @@ else
|
|||||||
db 'GENERAL DEBUG & MESSAGE BOARD'
|
db 'GENERAL DEBUG & MESSAGE BOARD'
|
||||||
.len = $ - header
|
.len = $ - header
|
||||||
end if
|
end if
|
||||||
|
krnl_cnt dd 0
|
||||||
|
vmode dd 0
|
||||||
|
targ dd text2
|
||||||
I_END:
|
I_END:
|
||||||
text rb 80*(MAXSTRINGS+1)
|
offs dd ?
|
||||||
tmp db ?
|
flag rb 1
|
||||||
|
ipcbuff rb IPC_BUF+20
|
||||||
|
rd 2
|
||||||
|
; x1pos dd ?
|
||||||
|
; y1pos dd ?
|
||||||
|
text1 rb 80*(MAXSTRINGS+1)
|
||||||
|
tmp1 db ?
|
||||||
|
rd 2
|
||||||
|
; x2pos dd ?
|
||||||
|
; y2pos dd ?
|
||||||
|
text2 rb 80*(MAXSTRINGS+1)
|
||||||
|
tmp2 db ?
|
||||||
|
work rb 4096
|
||||||
|
sel_byte dw ?,?
|
||||||
|
pid dd ?
|
||||||
xstart dd ?
|
xstart dd ?
|
||||||
sc system_colors
|
dump_len dd ?
|
||||||
|
sc system_colors
|
||||||
|
i_end:
|
||||||
|
@@ -1982,7 +1982,7 @@ exec_fileinfo:
|
|||||||
end_name db '/RD/1/END',0
|
end_name db '/RD/1/END',0
|
||||||
menu_name db '/RD/1/MENU',0
|
menu_name db '/RD/1/MENU',0
|
||||||
calendar_name db '/RD/1/CALENDAR',0
|
calendar_name db '/RD/1/CALENDAR',0
|
||||||
sysmeter_name db '/RD/1/SYSMETER',0
|
sysmeter_name db '/RD/1/GMON',0
|
||||||
|
|
||||||
dat_fileinfo:
|
dat_fileinfo:
|
||||||
dd 0
|
dd 0
|
||||||
|
@@ -107,29 +107,6 @@ still:
|
|||||||
jmp bg2
|
jmp bg2
|
||||||
|
|
||||||
|
|
||||||
set_default_colours:
|
|
||||||
|
|
||||||
pusha
|
|
||||||
|
|
||||||
mov eax,6 ; load default color map
|
|
||||||
mov ebx,defcol
|
|
||||||
mov ecx,0
|
|
||||||
mov edx,-1
|
|
||||||
mov esi,0x8000
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
mov eax,48 ; set default color map
|
|
||||||
mov ebx,2
|
|
||||||
mov ecx,0x8000
|
|
||||||
mov edx,10*4
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
popa
|
|
||||||
ret
|
|
||||||
|
|
||||||
defcol db 'DEFAULT.DTP'
|
|
||||||
|
|
||||||
|
|
||||||
check_parameters:
|
check_parameters:
|
||||||
|
|
||||||
cmp [I_Param],dword 'BOOT'
|
cmp [I_Param],dword 'BOOT'
|
||||||
@@ -137,7 +114,6 @@ check_parameters:
|
|||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
call set_default_colours
|
|
||||||
call load_texture
|
call load_texture
|
||||||
|
|
||||||
mov eax,15
|
mov eax,15
|
||||||
@@ -148,7 +124,8 @@ check_parameters:
|
|||||||
|
|
||||||
mov eax,15
|
mov eax,15
|
||||||
mov ebx,5
|
mov ebx,5
|
||||||
mov ecx,0x40000+1
|
mov ecx,0x40000 ; <<< 0x40000 for blue, 0x40000+1 for red,
|
||||||
|
; <<< 0x40000+2 for green background at boot
|
||||||
mov edx,0
|
mov edx,0
|
||||||
mov esi,256*3*256
|
mov esi,256*3*256
|
||||||
int 0x40
|
int 0x40
|
||||||
@@ -308,7 +285,7 @@ gentexture:
|
|||||||
ylup:
|
ylup:
|
||||||
mov ebx,0
|
mov ebx,0
|
||||||
|
|
||||||
call precalcbar
|
; call precalcbar
|
||||||
|
|
||||||
xlup:
|
xlup:
|
||||||
push edi
|
push edi
|
||||||
@@ -342,10 +319,10 @@ gentexture:
|
|||||||
|
|
||||||
mov eax,esi ; now evaluate color...
|
mov eax,esi ; now evaluate color...
|
||||||
|
|
||||||
cmp eax,255*24
|
; cmp eax,255*24
|
||||||
jbe ok2
|
; jbe ok2
|
||||||
; imul eax,12
|
; imul eax,12
|
||||||
ok2:
|
; ok2:
|
||||||
|
|
||||||
mov edi,24 ; 50 = max shaded distance
|
mov edi,24 ; 50 = max shaded distance
|
||||||
idiv edi
|
idiv edi
|
||||||
@@ -376,21 +353,21 @@ wrappit:
|
|||||||
nowrap:
|
nowrap:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
precalcbar:
|
;precalcbar:
|
||||||
pusha
|
; pusha
|
||||||
mov eax,1
|
; mov eax,1
|
||||||
mov ebx,ecx
|
; mov ebx,ecx
|
||||||
add ebx,18
|
; add ebx,18
|
||||||
mov ecx,44
|
; mov ecx,44
|
||||||
mov edx,0x00000060
|
; mov edx,0x00000060
|
||||||
bar:
|
; bar:
|
||||||
add ecx,2
|
; add ecx,2
|
||||||
add edx,0x00020100
|
; add edx,0x00020100
|
||||||
; int 0x40
|
; int 0x40
|
||||||
cmp ecx,298
|
; cmp ecx,298
|
||||||
jb bar
|
; jb bar
|
||||||
popa
|
; popa
|
||||||
ret
|
; ret
|
||||||
|
|
||||||
; *********************************************
|
; *********************************************
|
||||||
; ******* WINDOW DEFINITIONS AND DRAW *********
|
; ******* WINDOW DEFINITIONS AND DRAW *********
|
||||||
@@ -517,12 +494,7 @@ draw_window:
|
|||||||
mov ecx,(y_add2+40)*65536+14 ; button start y & size
|
mov ecx,(y_add2+40)*65536+14 ; button start y & size
|
||||||
|
|
||||||
newcb:
|
newcb:
|
||||||
push edx
|
mov esi,[(edx-14)*4+colors]
|
||||||
sub edx,14
|
|
||||||
shl edx,2
|
|
||||||
add edx,colors
|
|
||||||
mov esi,[edx]
|
|
||||||
pop edx
|
|
||||||
|
|
||||||
mov eax,8
|
mov eax,8
|
||||||
int 0x40
|
int 0x40
|
||||||
|
@@ -11,15 +11,14 @@ use32
|
|||||||
|
|
||||||
org 0x0
|
org 0x0
|
||||||
|
|
||||||
db 'MENUET01' ; 8 byte id
|
db 'MENUET01' ; 8 byte id
|
||||||
dd 0x01 ; header version
|
dd 0x01 ; header version
|
||||||
dd START ; start of code
|
dd START ; start of code
|
||||||
dd I_END ; size of image
|
dd I_END ; size of image
|
||||||
dd 0x5000 ; memory for app
|
dd 0x5000 ; memory for app
|
||||||
dd 0x4ff0 ; esp
|
dd 0x4ff0 ; esp
|
||||||
dd 0x0 , 0x0 ; I_Param , I_Icon
|
dd 0x0 , 0x0 ; I_Param , I_Icon
|
||||||
|
|
||||||
include 'lang.inc'
|
|
||||||
include 'macros.inc'
|
include 'macros.inc'
|
||||||
START: ; start of execution
|
START: ; start of execution
|
||||||
|
|
||||||
@@ -204,7 +203,7 @@ dw_continue:
|
|||||||
mov eax,0 ; function 0 : define and draw window
|
mov eax,0 ; function 0 : define and draw window
|
||||||
mov ebx,100*65536+400 ; [x start] *65536 + [x size]
|
mov ebx,100*65536+400 ; [x start] *65536 + [x size]
|
||||||
mov ecx,100*65536+200 ; [y start] *65536 + [y size]
|
mov ecx,100*65536+200 ; [y start] *65536 + [y size]
|
||||||
mov edx,0x030020C0;0x00000040 ; color of work area RRGGBB,8->color glide
|
mov edx,0x020020C0;0x00000040 ; color of work area RRGGBB,8->color glide
|
||||||
mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color glide
|
mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color glide
|
||||||
mov edi,0x00ffffff ; color of frames RRGGBB
|
mov edi,0x00ffffff ; color of frames RRGGBB
|
||||||
int 0x40
|
int 0x40
|
||||||
@@ -212,7 +211,14 @@ dw_continue:
|
|||||||
; WINDOW LABEL
|
; WINDOW LABEL
|
||||||
call print_my_title
|
call print_my_title
|
||||||
|
|
||||||
|
; CLOSE BUTTON
|
||||||
|
mov eax,8 ; function 8 : define and draw button
|
||||||
|
mov ebx,(400-19)*65536+12 ; [x start] *65536 + [x size]
|
||||||
|
mov ecx,5*65536+12 ; [y start] *65536 + [y size]
|
||||||
|
mov edx,1 ; button id
|
||||||
|
mov esi,0x5599cc ; button color RRGGBB
|
||||||
|
int 0x40
|
||||||
|
|
||||||
; BUTTONS
|
; BUTTONS
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
mov edx,eax
|
mov edx,eax
|
||||||
@@ -1016,7 +1022,7 @@ warning_window:
|
|||||||
|
|
||||||
warning_loop:
|
warning_loop:
|
||||||
mov eax,5
|
mov eax,5
|
||||||
mov ebx,10
|
mov ebx,13
|
||||||
int 0x40
|
int 0x40
|
||||||
mov eax,11
|
mov eax,11
|
||||||
int 40h
|
int 40h
|
||||||
|
Reference in New Issue
Block a user