/programs/other/outdated/mfar/trunk/build_en.bat |
---|
0,0 → 1,4 |
@echo lang fix en >lang.inc |
@fasm mfar.asm mfar |
@erase lang.inc |
@pause |
/programs/other/outdated/mfar/trunk/build_ru.bat |
---|
0,0 → 1,4 |
@echo lang fix ru >lang.inc |
@fasm mfar.asm mfar |
@erase lang.inc |
@pause |
/programs/other/outdated/mfar/trunk/macros.inc |
---|
0,0 → 1,227 |
; new application structure |
macro meos_app_start |
{ |
use32 |
org 0x0 |
db 'MENUET01' |
dd 0x01 |
dd __start |
dd __end |
dd __memory |
dd __stack |
if used __params & ~defined __params |
dd __params |
else |
dd 0x0 |
end if |
dd 0x0 |
} |
MEOS_APP_START fix meos_app_start |
macro code |
{ |
__start: |
} |
CODE fix code |
macro data |
{ |
__data: |
} |
DATA fix data |
macro udata |
{ |
if used __params & ~defined __params |
__params: |
db 0 |
__end: |
rb 255 |
else |
__end: |
end if |
__udata: |
} |
UDATA fix udata |
macro meos_app_end |
{ |
align 32 |
rb 2048 |
__stack: |
__memory: |
} |
MEOS_APP_END fix meos_app_end |
; macro for defining multiline text data |
struc mstr [sstring] |
{ |
forward |
local ssize |
virtual at 0 |
db sstring |
ssize = $ |
end virtual |
dd ssize |
db sstring |
common |
dd -1 |
} |
; language for programs |
lang fix ru ; ru en fr ge fi |
; code profiling |
macro STARTTIMER |
{ |
push ecx |
push ebx |
rdtsc |
push edx |
push eax |
} |
macro STOPTIMER ;edx:eax = cpu cycles ellapsed |
{ |
rdtsc |
pop ebx |
pop ecx |
clc |
sbb eax,ebx |
sbb edx,ecx |
pop ebx |
pop ecx |
} |
; optimize the code for size |
macro add arg1,arg2 |
{ |
if arg1 in <eax,ebx,ecx,edx,esi,edi,ebp,esp> |
if arg2 eqtype 0 |
if (arg2) = 1 |
inc arg1 |
else |
add arg1,arg2 |
end if |
else |
add arg1,arg2 |
end if |
else |
add arg1,arg2 |
end if |
} |
macro sub arg1,arg2 |
{ |
if arg2 eqtype 0 |
if (arg2) = 1 |
dec arg1 |
else |
sub arg1,arg2 |
end if |
else |
sub arg1,arg2 |
end if |
} |
macro mov arg1,arg2 |
{ |
if arg1 in <eax,ebx,ecx,edx,esi,edi,ebp,esp> |
if arg2 eqtype 0 |
if (arg2) = 0 |
xor arg1,arg1 |
else if (arg2) = 1 |
xor arg1,arg1 |
inc arg1 |
else if (arg2) = -1 |
or arg1,-1 |
else if (arg2) > -128 & (arg2) < 128 |
push arg2 |
pop arg1 |
else |
mov arg1,arg2 |
end if |
else |
mov arg1,arg2 |
end if |
else |
mov arg1,arg2 |
end if |
} |
macro struct name |
{ |
virtual at 0 |
name name |
sizeof.#name = $ - name |
end virtual |
} |
; 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 |
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 |
; constants |
; events |
EV_IDLE = 0 |
EV_TIMER = 0 |
EV_REDRAW = 1 |
EV_KEY = 2 |
EV_BUTTON = 3 |
EV_EXIT = 4 |
EV_BACKGROUND = 5 |
EV_MOUSE = 6 |
EV_IPC = 7 |
EV_STACK = 8 |
; event mask bits for function 40 |
EVM_REDRAW = 1b |
EVM_KEY = 10b |
EVM_BUTTON = 100b |
EVM_EXIT = 1000b |
EVM_BACKGROUND = 10000b |
EVM_MOUSE = 100000b |
EVM_IPC = 1000000b |
EVM_STACK = 10000000b |
/programs/other/outdated/mfar/trunk/menuet.inc |
---|
0,0 → 1,181 |
;------------------------------------------------------------------------------ |
;///// SYSTEM FUNCTIONS /////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
MF_TERMINATE = -1 |
MF_DEFWINDOW = 0 |
WS_GRADIENT = $80000000 |
WS_NOSIZE = $00000000 |
WS_TRANSP = $01000000 |
WS_NORMAL = $02000000 |
WS_SKINNED = $03000000 |
MF_PUTPIXEL = 1 |
MF_GETKEY = 2 |
MF_GETTIME = 3 |
MF_DRAWTEXT = 4 |
DT_FIXED = $00000000 |
DT_VARIABLE = $10000000 |
MF_DELAY = 5 |
MF_RDREADFILE = 6 |
MF_PUTIMAGE = 7 |
MF_DEFBUTTON = 8 |
DB_ADD = $00000000 |
DB_DELETE = $80000000 |
BS_HIDDEN = $40000000 |
MF_PRINFO = 9 |
PI_SELF = $FFFFFFFF |
MF_WAITEVENT = 10 |
MF_CHKEVENT = 11 |
MF_WNDDRAW = 12 |
WD_BEGINDRAW = 1 |
WD_ENDDRAW = 2 |
MF_FILLRECT = 13 |
FR_GRADIENT = $80000000 |
MF_GETSCRDIM = 14 |
MF_SETBKGND = 15 |
BG_SETSIZE = 1 |
BG_PUTPIXEL = 2 |
BG_REDRAW = 3 |
BG_SETSTYLE = 4 |
BGS_TILE = 1 |
BGS_STRETCH = 2 |
BG_SETIMAGE = 5 |
MF_RAM2FLOP = 16 |
R2F_ALL = 1 |
MF_GETPRSDBTNID = 17 |
MF_SYSSERV = 18 |
SYS_QUIT = 1 |
SYS_KILLPR = 2 |
SYS_SETFOCUS = 3 |
SYS_GETIDLE = 4 |
SYS_SETSPEED = 5 |
SYS_RAM2HARD = 6 |
MF_STARTPRG = 19 |
MF_MIDI = 20 |
MIDI_RESET = 1 |
MIDI_OUTPUT = 2 |
MF_DEVSETUP = 21 |
DEV_MIDI = 1 |
DEV_KEYB = 2 |
DEV_CD = 3 |
DEV_SB16 = 4 |
DEV_LANG = 5 |
DEV_WSS = 6 |
DEV_HD = 7 |
DEV_HDPART = 8 |
DEV_DMA = 10 |
DEV_LOWHDACC = 11 |
DEV_PCIACC = 12 |
DEV_VIDEODRV = 13 |
MF_WAITEVWTO = 23 |
MF_CDAUDIO = 24 |
CDA_PLAY = 1 |
CDA_GETPLIST = 2 |
CDA_STOP = 3 |
MF_SB16M1 = 25 |
SB_SETMAINVOL = 1 |
SB_SETCDVOL = 2 |
MF_GETDEVPREF = 26 |
DEV_GETTICKS = 9 |
MF_SOUNDPROPS = 27 |
MF_SB16M2 = 28 |
MF_GETDATE = 29 |
MF_HDREADFILE = 30 |
MF_HDSTARTPRG = 31 |
MF_RDDELFILE = 32 |
MF_RDWRITEFILE = 33 |
MF_RDREADDIR = 34 |
MF_GETPIXEL = 35 |
MF_MOUSEINFO = 37 |
MI_SCREENCRD = 0 |
MI_CLIENTCRD = 1 |
MI_BUTTONS = 2 |
MB_NONE = 0 |
MB_LEFT = 1 |
MB_RIGHT = 2 |
MB_BOTH = 3 |
MF_DRAWLINE = 38 |
MF_GETBKGND = 39 |
GB_SIZE = 1 |
GB_PIXEL = 2 |
GB_STYLE = 4 |
MF_SETEVMASK = 40 |
MF_GETIRQOWNER = 41 |
MF_GETIRQDATA = 42 |
MF_PORTIO = 43 |
MF_SETIRQTABLE = 44 |
MF_MANAGEIRQS = 45 |
IRQ_RESERVE = 0 |
IRQ_RELEASE = 1 |
MF_MANAGEPORTS = 46 |
PORT_RESERVE = 0 |
PORT_RELEASE = 1 |
MF_DRAWNUMBER = 47 |
DN_NUMBER = $00000000 |
DN_POINTER = $00000001 |
DN_DEC = $00000000 |
DN_HEX = $00000100 |
DN_BIN = $00000200 |
MF_WINPROPS = 48 |
WP_REDRAW = 0 |
WPR_DESKTOP = 0 |
WP_SETBTNSTYLE = 1 |
BS_FLAT = 0 |
BS_3D = 1 |
WP_SETSYSCLRS = 2 |
WP_GETSYSCLRS = 3 |
WP_GETSKINH = 4 |
MF_WINFREEFORM = 50 |
FF_SETSHAPE = 0 |
FF_SETSCALE = 1 |
MF_THREAD = 51 |
TH_CREATE = 1 |
MF_STACK = 52 |
MF_SOCKET = 53 |
MF_SOUND = 55 |
SND_LOADBLOCK = 0 |
SND_PLAYBLOCK = 1 |
SND_SETFORMAT = 2 |
SF_SETLENGTH = 1 |
;MF_HDWRITEFILE = 56 |
;MF_HDDELFILE = 57 |
MF_FSACCESS = 70 |
FS_READ = 999999 |
FS_READ_FILE = 0 |
FS_READ_FOLDER = 1 |
FS_WRITE_FILE = 2 |
FS_APPEND = 3 |
FS_EXECUTE = 7 |
FS_DELETE = 8 |
FS_CREATE_FOL = 9 |
MF_SYSTRACE = 59 |
ST_GETEVENTS = 0 |
MF_IPC = 60 |
IPC_SETAREA = 1 |
IPC_SENDMSG = 2 |
MF_GRAPHPROPS = 61 |
GP_PERMIT = 1 |
GP_GETBPP = 2 |
GP_GETBPS = 3 |
MF_PCI = 62 |
MF_DEBUGBRD = 63 |
DBG_WRITE = 1 |
DBG_READ = 2 |
MF_MEMRESIZE = 64 |
MR_SETSIZE = 1 |
MF_UTF = 65 |
MF_KEYBMODE = 66 |
KM_SETMODE = 1 |
KM_GETMODE = 2 |
;------------------------------------------------------------------------------ |
;///// ERROR CODES //////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
ERR_SUCCESS = 0 |
ERR_FS_FIRST = 1 |
ERR_FS_LAST = 6 |
ERR_IRQ_NODATA = 1 |
ERR_IRQ_BADOWNER = 2 |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
/programs/other/outdated/mfar/trunk/mf-copy.inc |
---|
0,0 → 1,204 |
;------------------------------------------------------------------------------ |
;///// COPYING //////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
func copy_file |
pushad |
cmp [active_panel],0 |
jne ._00 |
push f_path0 |
push [f_plen0] |
mov eax,[d_lpos] |
shl eax,4 |
add eax,lstart |
push eax |
mov esi,f_path1 |
mov eax,[f_plen1] |
jmp @f |
._00: |
push f_path1 |
push [f_plen1] |
mov eax,[d_rpos] |
shl eax,4 |
add eax,rstart |
push eax |
mov esi,f_path0 |
mov eax,[f_plen0] |
@@: |
mov ebx,[esp] |
test byte[ebx+11],FA_FOLDER |
jz @f |
add esp,3*4 |
stc |
jmp .close |
@@: |
mov edi,fc_info.path |
call get_normal_path |
mov eax,[len] |
mov byte[edi+eax-1],'/' |
mov [fc_len2],eax |
pop esi |
call get_file_info |
mov eax,[f_size] |
mov [fc_size],eax |
pop eax |
pop esi |
mov edi,f_info.path |
call get_normal_path |
mov eax,[len] |
mov byte[edi+eax-1],'/' |
mov [fc_len1],eax |
jmp .redraw_copy |
.redraw: |
call draw_window_full |
.redraw_copy: |
call draw_window_copy_main |
.still: |
mcall MF_WAITEVENT |
jmpe al,.still,\ |
EV_REDRAW,.redraw,\ |
EV_KEY,.key,\ |
EV_BUTTON,.button |
.key: |
mcall MF_GETKEY |
jmpe ah,.still,\ |
VK_ESCAPE,._close,\ |
VK_RETURN,.copy |
.button: |
jmp .still |
.copy: |
mov ecx,[fc_size] |
shr ecx,9 |
inc ecx |
push ecx |
shl ecx,9 |
add ecx,MEM_USED |
mcall MF_MEMRESIZE,MR_SETSIZE |
or eax,eax |
jnz .close |
mov edi,file_info |
mov al,' ' |
mov ecx,13 |
repne scasb |
sub ecx,12 |
neg ecx |
push ecx |
mov esi,file_info |
mov edi,f_info.path |
add edi,[fc_len1] |
rep movsb |
mov byte[edi],0 |
pop ecx |
mov esi,file_info |
mov edi,fc_info.path |
add edi,[fc_len2] |
rep movsb |
mov byte[edi],0 |
xor eax,eax ; FS_READ |
mov [f_info],eax |
mov [f_info+4],eax |
pop eax |
mov [f_info+8],eax |
mov dword[f_info+12],MEM_USED |
mcall MF_FSACCESS,f_info |
mov eax,[fc_size] |
mov [fc_info+8],eax |
mcall MF_FSACCESS,fc_info |
mcall MF_MEMRESIZE,MR_SETSIZE,MEM_USED |
._close: |
clc |
.close: |
popad |
ret |
endf |
;------------------------------------------------------------------------------ |
func draw_window_copy_main |
mcall2 MF_FILLRECT,oX+tW*2,tW*76,oY+tH*7,tH*8,0x00C0C0C0 |
mmov esi,oX+tW*4+2,oX+tW*75+3 |
mmov edi,oY+tH*8+3,oY+tH*13+5 |
xor edx,edx |
call draw_frame |
mmov esi,oX+tW*4+4,oX+tW*75+1 |
mmov edi,oY+tH*8+5,oY+tH*13+3 |
call draw_frame |
mcall2 MF_DRAWLINE,oX+tW*4+4,oX+tW*75+1,oY+tH*11+3,oY+tH*11+3,0 |
mcall2 MF_FILLRECT,oX+tW*40-(sz_copy.size-2)*tW/2-tW,sz_copy.size*tW,\ |
oY+tH*8+3,3,0x00C0C0C0 |
mcall1 MF_DRAWTEXT,oX+tW*40-(sz_copy.size-2)*tW/2,oY+tH*8,\ |
0x00000000,sz_copy,sz_copy.size-2 |
mcall1 ,oX+tW*6,oY+tH*9,,,sz_copy.size |
mov edi,file_info |
mov al,' ' |
mov ecx,13 |
repne scasb |
madd ebx,(sz_copy.size)*tW,0 |
mov esi,ecx |
sub esi,12 |
neg esi |
mcall MF_DRAWTEXT,,,file_info |
imul esi,tW |
shl esi,16 |
add ebx,esi |
mcall ,,,sz_copyto,sz_copyto.size |
call draw_copy_input |
ret |
endf |
;------------------------------------------------------------------------------ |
func draw_copy_input |
mcall2 MF_FILLRECT,oX+tW*6,tW*68,oY+tH*10,tH,0x00008080 |
mov edx,fc_info.path |
mov esi,[fc_len2] |
cmp esi,68 |
jb @f |
sub esi,68 |
lea edx,[edx+esi+1] |
mov esi,67 |
@@: |
mcall1 MF_DRAWTEXT,oX+tW*6,oY+tH*10+1,0x00000000 |
ret |
endf |
;------------------------------------------------------------------------------ |
;fc_pst db 0 |
;fc_cur db 0 |
align 4 |
fc_size dd ? |
fc_len1 dd 0 |
fc_len2 dd 0 |
fc_info: |
dd 1 |
dd 0 |
dd ? |
dd MEM_USED |
dd MEM_FOR_OS |
.path: |
rb 200 |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
/programs/other/outdated/mfar/trunk/mf-sort.inc |
---|
0,0 → 1,140 |
;------------------------------------------------------------------------------ |
;///// SORTING //////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
r_sort db 1 |
l_sort db 1 |
align 4 |
compare_table: |
dd compare_by_name |
dd compare_by_extension |
; AL = panel |
func mfar_sort |
pusha |
cmp al,0 |
jne ._00 |
mov eax,[d_lcnt] |
mov edi,lstart |
movzx edx,[l_sort] |
jmp @f |
._00: |
mov eax,[d_rcnt] |
mov edi,rstart |
movzx edx,[r_sort] |
@@: |
mov edx,[edx*4+compare_table] |
cmp eax,2 |
jbe .exit |
dec eax |
shl eax,4 |
add eax,edi |
cmp word[edi],'..' |
jne @f |
add edi,16 |
@@: |
push edi |
mov esi,edi |
add edi,16 |
.next_file: |
call edx |
add edi,16 |
cmp edi,eax |
jbe .next_file |
mov ebx,12 |
@@: |
mov ecx,[ebx+eax] |
xchg [ebx+esi],ecx |
mov [ebx+eax],ecx |
sub ebx,4 |
jge @b |
mov esi,[esp] |
mov edi,esi |
add edi,16 |
sub eax,16 |
cmp eax,edi |
jge .next_file |
pop edi |
.exit: |
popad |
ret |
endf |
;------------------------------------------------------------------------------ |
; ESI = pointer to 1st file info |
; EDI = pointer to 2nd file info |
func compare_by_name |
mov ecx,11 |
push edi esi |
repe cmpsb |
pop esi edi |
pushfd |
test byte[esi+11],FA_FOLDER |
jnz ._00 |
test byte[edi+11],FA_FOLDER |
jz ._01 |
jmp ._03 |
._00: |
test byte[edi+11],FA_FOLDER |
jz ._02 |
._01: |
popfd |
jg ._04 |
mov esi,edi |
ret |
._02: |
popfd |
mov esi,edi |
ret |
._03: |
popfd |
._04: |
ret |
endf |
;------------------------------------------------------------------------------ |
; ESI = pointer to 1st file info |
; EDI = pointer to 2nd file info |
func compare_by_extension |
push edi esi |
mov ecx,3 |
add esi,8 |
add edi,8 |
repe cmpsb |
jne ._00 |
mov esi,[esp] |
mov edi,[esp+4] |
mov ecx,8 |
repe cmpsb |
._00: |
pop esi edi |
pushfd |
test byte[esi+11],FA_FOLDER |
jnz ._01 |
test byte[edi+11],FA_FOLDER |
jz ._02 |
jmp ._04 |
._01: |
test byte[edi+11],FA_FOLDER |
jz ._03 |
._02: |
popfd |
jg ._05 |
mov esi,edi |
ret |
._03: |
popfd |
mov esi,edi |
ret |
._04: |
popfd |
._05: |
ret |
endf |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
/programs/other/outdated/mfar/trunk/mfar.asm |
---|
0,0 → 1,1180 |
; MENUET FAR [MFAR] PRE-ALPHA-8.1 |
; 2003-2004 (C) Mike Semenyako aka mike.dld |
; Compile with FASM for Menuet |
use32 |
org 0 |
db 'MENUET01' ; 8 byte id |
dd $01 ; header version |
dd START ; start of code |
dd I_END ; size of image |
dd MEM_USED ; memory for app |
dd $007FF0 ; esp |
dd $00,$00 ; I_Param , I_Icon |
; |
; START:SIZE |
; |
; +00000000:00007FF0 - image |
; +00007FF0:00007FF0 - stack |
; +00008000:00000300 - path strings buffer |
; +00008300:0003FD00 - files data |
; +00048000:00000300 - temporary file read area |
; +00048300:00004000 - memory for OS (read/write buffer) |
; +0004C300:FFFB3CFF - dinamically allocated for copy, view, edit etc. |
; |
include 'macros.inc' |
include 'menuet.inc' |
include 'mfar.inc' |
START: |
mcall MF_RDREADFILE,fcfile,0,-1,fc ; read user colors |
mov esi,p_rd ; left panel = RD |
mov edi,f_path0 |
mov ecx,p_rd.size |
rep movsb |
mov esi,p_hd ; right panel = HD |
mov edi,f_path1 |
mov ecx,p_hd.size |
rep movsb |
redraw_all: |
call draw_window_full |
jmp still |
redraw_files: |
call draw_files |
still: |
mcall MF_WAITEVWTO,100 ; waiting 1 sec |
jmpe al,,\ |
EV_REDRAW,redraw_all,\ |
EV_KEY,key,\ |
EV_BUTTON,button |
; after every 1 second [when no other events occur] updating files info |
; eg. requesting ACTIVE panel files data and drawing it |
;; timed redraw { |
mov dl,[active_panel] |
cmp dl,0 |
jne ._00 |
push [d_ltsz] |
jmp @f |
._00: |
push [d_rtsz] |
@@: |
call get_files_data |
pop eax |
cmp dl,0 |
jne ._01 |
cmp eax,[d_ltsz] |
jmp @f |
._01: |
cmp eax,[d_rtsz] |
@@: |
je still ; nothing happened, waiting again |
mov al,dl |
jmp redraw_files |
;; } |
; key pressed event |
key: |
mcall MF_GETKEY ; get key-code |
movzx ecx,[active_panel] |
jmpe ah,k_directional,\ |
VK_RETURN,k_return,\ ; execute something |
VK_TAB,k_tab,\ ; change active panel |
VK_F5,k_f5,\ ; copy |
VK_F10,mfar_exit,\ ; terminate |
VK_CTRLF3,k_ctrl_f3,\ ; sort by name |
VK_CTRLF4,k_ctrl_f4 ; sort by extension |
;------------------------------------------------------------------------------ |
k_return: |
call execute_current_file |
jmp still |
;------------------------------------------------------------------------------ |
k_tab: |
mov edi,[fc.background] |
call draw_sel ; hide current file selection |
xor [active_panel],1 ; changing active panel |
call draw_path ; drawing path of new panel |
mov dl,[active_panel] |
call get_files_data ; requesting panel files info |
mov edi,sel_color |
call draw_sel ; show current file |
mov al,[active_panel] |
call draw_file_info ; and its info (size,date) |
jmp still |
;------------------------------------------------------------------------------ |
k_f5: |
call copy_file |
jc still |
jmp redraw_all |
;------------------------------------------------------------------------------ |
k_ctrl_f3: |
jecxz ._00 |
cmp [r_sort],0 |
je still |
mov [r_sort],0 |
jmp @f |
._00: |
cmp [l_sort],0 |
je still |
mov [l_sort],0 |
@@: |
mov al,cl |
call mfar_sort |
jmp redraw_files |
;------------------------------------------------------------------------------ |
k_ctrl_f4: |
jecxz ._00 |
cmp [r_sort],1 |
je still |
mov [r_sort],1 |
jmp @f |
._00: |
cmp [l_sort],1 |
je still |
mov [l_sort],1 |
@@: |
mov al,al |
call mfar_sort |
jmp redraw_files |
;------------------------------------------------------------------------------ |
k_directional: |
cmp ah,VK_LEFT ; non-directional keys ? |
jb still ; ignore them |
cmp ah,VK_END |
ja still |
jecxz ._00 |
mov edx,[d_rpos] |
mov ebx,[d_rtop] |
mov esi,[d_rcnt] |
jmp @f |
._00: |
mov edx,[d_lpos] |
mov ebx,[d_ltop] |
mov esi,[d_lcnt] |
@@: |
xor ebp,ebp ; redraw whole panel [0-no, 1-yes] |
;------------------------------------------------------------------------------ |
jmpe ah,show_cur,\ |
VK_LEFT,k_left,\ |
VK_DOWN,k_down,\ |
VK_UP,k_up,\ |
VK_RIGHT,k_right,\ |
VK_HOME,k_home,\ |
VK_END,k_end |
k_left: |
cmp edx,0 |
je still |
sub edx,FPC |
jge @f |
xor edx,edx |
@@: |
mov eax,edx |
sub eax,ebx |
jge show_cur |
inc ebp |
sub ebx,FPC |
jge show_cur |
xor ebx,ebx |
jmp show_cur |
;------------------------------------------------------------------------------ |
k_down: |
lea eax,[esi-1] |
cmp edx,eax |
je still |
inc edx |
mov eax,edx |
sub eax,ebx |
cmp eax,FPC*3-1 |
jle show_cur |
inc ebp |
inc ebx |
jmp show_cur |
;------------------------------------------------------------------------------ |
k_up: |
cmp edx,0 |
je still |
dec edx |
mov eax,ebx |
cmp edx,eax |
jge show_cur |
inc ebp |
dec ebx |
jmp show_cur |
;------------------------------------------------------------------------------ |
k_right: |
lea eax,[esi-1] |
cmp edx,eax |
je still |
add edx,FPC |
cmp edx,eax |
jle @f |
mov edx,eax |
@@: |
mov eax,edx |
sub eax,ebx |
cmp eax,FPC*3-1 |
jle show_cur |
inc ebp |
add ebx,FPC |
jmp show_cur |
;------------------------------------------------------------------------------ |
k_home: |
cmp edx,0 |
je still |
inc ebp |
xor edx,edx |
xor ebx,ebx |
jmp show_cur |
;------------------------------------------------------------------------------ |
k_end: |
lea eax,[esi-1] |
cmp edx,eax |
je still |
mov edx,eax |
mov edi,eax |
sub edi,ebx |
cmp edi,FPC*3-1 |
jle show_cur |
inc ebp |
sub eax,FPC*3-1 |
mov ebx,eax |
;------------------------------------------------------------------------------ |
show_cur: |
mov edi,[fc.background] |
call draw_sel |
jecxz ._00 |
mov [d_rpos],edx |
mov [d_rtop],ebx |
jmp @f |
._00: |
mov [d_lpos],edx |
mov [d_ltop],ebx |
@@: |
cmp ebp,0 |
mov al,cl |
jne redraw_files |
mov edi,[fc.selection] |
call draw_sel |
call draw_file_info |
jmp still |
button: |
mcall MF_GETPRSDBTNID |
cmp ah,1 |
jne noclose |
mfar_exit: |
mcall MF_RDDELFILE,fcfile ; delete existing mfar.dat |
mcall MF_RDWRITEFILE,fcfile,fc,12*4,0 ; create new mfar.dat |
mcall MF_TERMINATE ; close program |
noclose: |
jmp still |
;------------------------------------------------------------------------------ |
;///// DRAW WINDOW //////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
func draw_window |
mcall MF_WINPROPS,WP_GETSYSCLRS,sc,sizeof.system_colors |
mcall MF_WNDDRAW,WD_BEGINDRAW |
mov edx,[fc.background] |
or edx,$14000000 |
mov edi,caption |
mcall2 MF_DEFWINDOW,90,oX+tW*80+4,45,oY+tH*25+4 |
mmov esi,oX+2,oX+tW*39+2 |
mmov edi,oY+3,oY+tH*22+3 |
mov edx,[fc.default] |
call draw_frame |
mmov esi,oX+tW*40+2,oX+tW*79+2 |
call draw_frame |
mcall2 MF_DRAWLINE,oX+tW*13+2,oX+tW*13+2,oY+tH,oY+tH*20+3 |
madd ebx,tW*13,tW*13 |
mcall |
mcall2 ,oX+3,oX+tW*39+1,oY+tH*20+3,oY+tH*20+3 |
mcall2 ,oX+tW*53+2,oX+tW*53+2,oY+tH,oY+tH*20+3 |
madd ebx,tW*13,tW*13 |
mcall |
mcall2 ,oX+tW*40+3,oX+tW*79+1,oY+tH*20+3,oY+tH*20+3 |
mcall1 MF_DRAWTEXT,oX+tW*5,oY+tH,$00ffff00,lname,lname.size |
mcall1 ,oX+tW*18,oY+tH |
mcall1 ,oX+tW*31,oY+tH |
mcall1 ,oX+tW*45,oY+tH |
mcall1 ,oX+tW*58,oY+tH |
mcall1 ,oX+tW*71,oY+tH |
movzx edi,[l_sort] |
lea edx,[edi+sort_kind] |
mcall1 ,oX+tW,oY+tH,$00ffff00,,1 |
movzx edi,[r_sort] |
lea edx,[edi+sort_kind] |
mcall1 ,oX+tW*41,oY+tH |
call draw_path |
call draw_bottom_keys |
mcall MF_WNDDRAW,WD_ENDDRAW |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
func draw_window_full |
call draw_window |
mov edx,1 |
call get_files_data |
mov al,1 |
call draw_files |
mov edx,0 |
call get_files_data |
mov al,0 |
call draw_files |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
align 4 |
len dd ? |
func get_normal_path |
pusha |
mov ecx,5 |
rep movsb |
dec esi |
dec edi |
mov ecx,5 |
push eax |
@@: |
dec dword[esp] |
jz @f |
lodsb |
cmp al,0 |
je @b |
cmp al,' ' |
je @b |
stosb |
inc ecx |
jmp @b |
@@: |
pop eax |
mov byte[edi],'>' |
mov [len],ecx |
popa |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
; EAX = length needed |
; ECX = current length |
; EDI = path string |
func get_path_ellipses |
cmp ecx,eax |
jbe @f |
pushad |
lea esi,[edi+ecx+3+6] ; ... + /??/?/ |
sub esi,eax |
add ecx,edi |
sub ecx,esi |
mov dword[edi+6],'... ' |
add edi,9 |
cld |
rep movsb |
mov [len],eax |
popad |
@@: |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
func draw_path |
pushad |
cmp [active_panel],0 |
jne ._00 |
mov esi,f_path0 |
mov eax,[f_plen0] |
jmp @f |
._00: |
mov esi,f_path1 |
mov eax,[f_plen1] |
@@: |
mov edi,f_pathn |
call get_normal_path |
mov eax,39 |
mov ecx,[len] |
mov edi,f_pathn |
call get_path_ellipses |
mcall2 MF_FILLRECT,oX-1,tW*80+1,oY+tH*23-1,tH,[fc.pathbg] |
mcall1 MF_DRAWTEXT,oX,oY+tH*23,[fc.path],f_pathn,[len] |
popad |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
; AL = panel |
func draw_files |
push eax |
mmov ecx,oY+tH*2-1,tH*FPC |
mov edx,[fc.background] |
cmp al,0 |
mov eax,MF_FILLRECT |
jne ._00 |
mcall1 ,oX+tW-2,tW*12+3 |
mcall1 ,oX+tW*14-2,tW*12+3 |
mcall1 ,oX+tW*27-2,tW*12+3 |
mmov ebx,oX+tW,oY+tH*2 |
mov edx,[d_ltop] |
shl edx,4 |
add edx,lstart |
mov edi,[d_lcnt] |
mov esi,edi |
sub edi,[d_ltop] |
jmp @f |
._00: |
mcall1 ,oX+tW*41-2,tW*12+3 |
mcall1 ,oX+tW*54-2,tW*12+3 |
mcall1 ,oX+tW*67-2,tW*12+3 |
mmov ebx,oX+tW*41,oY+tH*2 |
mov edx,[d_rtop] |
shl edx,4 |
add edx,rstart |
mov edi,[d_rcnt] |
mov esi,edi |
sub edi,[d_rtop] |
@@: |
cmp esi,0 |
je .exit_nok ; no files |
mov ecx,3 |
.next_col: |
push ecx |
mov ecx,FPC |
.next_row: |
dec edi |
jge @f |
pop eax |
jmp .exit_ok |
@@: |
push ecx |
call get_file_color |
mov esi,edx |
call get_file_name |
push edx |
mcall 4,,,f_name,12 ; draw file name |
pop edx ecx |
add ebx,tH |
add edx,16 |
dec ecx |
jnz .next_row |
pop ecx |
dec ecx |
jz .exit_ok |
madd ebx,tW*13,0 |
mov bx,oY+tH*2 |
jmp .next_col |
.exit_ok: |
mov edi,sel_color |
call draw_sel |
.exit_nok: |
pop eax |
call draw_file_info |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
func draw_bottom_keys |
pushad |
mcall2 MF_FILLRECT,oX-1,tW*80+1,oY+tH*24-1,tH+1,[fc.pathbg] |
dec ecx |
mcall1 ,oX+tW-1,tW*6+1,,[fc.keysbg] |
mov esi,7 |
@@: |
madd ebx,tW*8,0 |
mcall |
dec esi |
jge @b |
mcall1 ,oX+tW*73-1,tW*7+1 |
mcall MF_DRAWNUMBER,$00010100,1,oX*65536+(oY+tH*24),[fc.path] |
sub edx,$00010000 |
@@: |
inc cl |
madd edx,tW*8,0 |
mcall |
cmp cl,10 |
jb @b |
mcall1 MF_DRAWTEXT,oX+tW,oY+tH*24,[fc.keys],btmkeys,btmkeys.size |
popad |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
; ESI = X1*65536+X2 |
; EDI = Y1*65536+Y2 |
; EDX = color |
func draw_frame |
mov ecx,edi |
mov ebx,edi |
shr ebx,16 |
mov cx,bx |
mcall MF_DRAWLINE,esi |
mov ecx,edi |
shl ecx,16 |
mov cx,di |
mcall |
mov ebx,esi |
mov ecx,esi |
shr ecx,16 |
mov bx,cx |
mcall ,,edi |
mov ebx,esi |
shl ebx,16 |
mov bx,si |
mcall |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
; EDX = pointer to file data |
func get_file_color |
push esi |
mov cl,[edx+11] |
test cl,(FA_HIDDEN or FA_SYSTEM) |
jz @f |
mov ecx,[fc.system] |
jmp .exit |
@@: |
test cl,FA_FOLDER |
jz @f |
mov ecx,[fc.folder] |
jmp .exit |
@@: |
mov ecx,[edx+7] |
and ecx,$ffffff00 |
or ecx,$00000020 |
mov esi,ext0-4 |
@@: |
lodsd |
or eax,eax |
jz @f |
cmp ecx,eax |
jne @b |
mov ecx,[fc.executable] |
jmp .exit |
@@: |
lodsd |
or eax,eax |
jz @f |
cmp ecx,eax |
jne @b |
mov ecx,[fc.bitmap] |
jmp .exit |
@@: |
lodsd |
or eax,eax |
je @f |
cmp ecx,eax |
jne @b |
mov ecx,[fc.source] |
jmp .exit |
@@: |
mov ecx,[fc.default] |
.exit: |
pop esi |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
; EDI = color |
func draw_sel |
pushad |
cmp [active_panel],0 |
jne ._00 |
mov eax,[d_lpos] |
sub eax,[d_ltop] |
mov esi,[d_lcnt] |
jmp @f |
._00: |
mov eax,[d_rpos] |
sub eax,[d_rtop] |
mov esi,[d_rcnt] |
@@: |
cmp esi,0 |
je .exit |
mov cl,FPC |
div cl |
mov bp,ax |
and eax,$000000FF |
mov cl,tW*13 |
mul cl |
add ax,oX+tW-2 |
push eax |
shl eax,16 |
mov ax,tW*12+3 |
mov ebx,eax |
mov ax,bp |
shr eax,8 |
and eax,$000000FF |
mov cl,tH |
mul cl |
add ax,oY+tH*2-1 |
push eax |
shl eax,16 |
mov ax,tH |
mov ecx,eax |
mov edx,edi |
cmp [active_panel],0 |
je @f |
madd ebx,(40*6),0 |
@@: |
mcall MF_FILLRECT |
pop eax |
movzx ebx,ax |
inc bx |
pop eax |
add ax,2 |
shl eax,16 |
or ebx,eax |
cmp [active_panel],0 |
jne ._01 |
mov edx,[d_lpos] |
shl edx,4 |
add edx,lstart |
jmp @f |
._01: |
mov edx,[d_rpos] |
shl edx,4 |
add edx,rstart |
@@: |
mov esi,edx |
call get_file_name |
call get_file_color |
cmp ecx,edi |
jne @f |
xor ecx,ecx |
@@: |
cmp [active_panel],0 |
je @f |
madd ebx,tW*40,0 |
@@: |
mcall MF_DRAWTEXT,,,f_name,12 |
.exit: |
popad |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
; AL = panel |
func draw_file_info |
push eax |
mmov ecx,oY+tH*21,tH |
mov edx,[fc.background] |
cmp al,0 |
mov eax,MF_FILLRECT |
jne ._00 |
mcall1 ,oX+tW,tW*38+1 |
mov esi,[d_lpos] |
shl esi,4 |
add esi,lstart |
mov edi,[d_lcnt] |
jmp @f |
._00: |
mcall1 ,oX+tW*41,tW*38+1 |
mov esi,[d_rpos] |
shl esi,4 |
add esi,rstart |
mov edi,[d_rcnt] |
@@: |
cmp edi,0 |
jne @f |
pop eax |
ret |
@@: |
call get_file_info |
mov dword[file_info+17],' ' |
mov word[file_info+15],' ' |
test byte[esi+11],FA_FOLDER |
jz @f |
mov dword[file_info+21],' DIR' |
jmp .no_size |
@@: |
mov dword[file_info+21],' ' |
mov eax,[f_size] |
mov esi,file_info+24 |
mov ebx,10 |
mov ecx,ebx |
@@: |
xor edx,edx |
div ebx |
add dl,'0' |
mov [esi],dl |
or eax,eax |
jz .no_size |
dec esi |
loop @b |
.no_size: |
pop eax |
mmov edx,oX+tW*35,oY+tH*21 |
mmov ebx,oX+tW,oY+tH*21 |
cmp al,0 |
je @f |
madd edx,tW*40,0 |
madd ebx,tW*40,0 |
@@: |
push edx |
mcall MF_DRAWTEXT,,[fc.default],file_info,34 |
pop edx |
mov esi,ecx |
mov cx,[f_year] |
mcall MF_DRAWNUMBER,$00040000 |
sub edx,$00240000 ; 6*6 = $24 |
movzx ecx,[f_day] |
mcall ,$00020000 |
add edx,$00120000 |
mov cl,[f_mnth] |
mcall |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
func get_file_name |
pushad |
mov eax,[esi+0] |
mov [f_name+0],eax |
mov eax,[esi+4] |
mov [f_name+4],eax |
mov eax,[esi+8] |
shl eax,8 |
and eax,$FFFFFF00 |
or al,$00000020 |
mov [f_name+8],eax |
popad |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
; ESI = pointer to file data |
func get_file_info |
pushad |
mov eax,[esi+12] |
mov dword[f_info],FS_READ |
mov [f_info+4],eax |
mov dword[f_info+12],read_area |
mcall MF_FSACCESS,f_info |
cmp eax,ERR_SUCCESS |
je @f |
cmp eax,ERR_FS_LAST |
ja @f |
popad |
stc |
ret |
@@: |
mov eax,read_area |
mov ecx,16 |
.next_file: |
mov edx,[esi+0] |
cmp [eax+0],edx |
jne @f |
mov edx,[esi+4] |
cmp [eax+4],edx |
jne @f |
mov edx,[esi+8] |
cmp [eax+8],edx |
jne @f |
mov esi,eax |
jmp .found |
@@: |
add eax,32 |
loop .next_file |
.found: |
push esi |
mov eax,' ' |
mov ecx,3 |
mov edi,file_info |
rep stosd |
mov edi,file_info |
mov ecx,2 |
rep movsd |
mov edi,file_info |
@@: |
cmp byte[edi],' ' |
jbe @f |
inc edi |
jmp @b |
@@: |
mov eax,[esi] |
shl eax,8 |
mov al,'.' |
cmp eax,'. ' |
je @f |
mov [edi],eax |
@@: |
pop esi |
mov eax,[esi+28] |
mov [f_size],eax |
mov eax,[esi+24] |
mov [f_day],al |
and [f_day],00011111b |
shr eax,5 |
mov [f_mnth],al |
and [f_mnth],00001111b |
shr eax,4 |
mov [f_year],ax |
and [f_year],01111111b |
add [f_year],1980 |
popad |
clc |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
; DL = panel |
func get_files_data |
pushad |
mov [d_tcnt],0 |
mov [d_ttsz],0 |
cmp dl,0 |
jne ._00 |
mov esi,f_path0 |
mov ecx,[f_plen0] |
jmp @f |
._00: |
mov esi,f_path1 |
mov ecx,[f_plen1] |
@@: |
push edi |
mov edi,f_info.path |
mov byte[edi+ecx],0 |
rep movsb |
pop edi |
cmp dl,0 |
jne ._01 |
mov edi,lstart |
jmp @f |
._01: |
mov edi,rstart |
@@: |
push edx |
xor ebp,ebp |
mov dword[f_info],FS_READ ; read |
mov dword[f_info+8],1 ; 1 block |
mov dword[f_info+12],read_area ; to read_area |
.next_block: |
mov dword[f_info+4],ebp ; starting from block #ebp |
mcall MF_FSACCESS,f_info |
cmp eax,ERR_SUCCESS |
je @f |
cmp eax,ERR_FS_LAST |
ja @f |
jmp .exit |
@@: |
mov esi,read_area |
mov ecx,16 |
.next_file: |
cmp word[esi],0 ; end of entries |
je .exit |
cmp word[esi],'. ' ; self-pointer |
je .skip |
test byte[esi+11],FA_LABEL ; disk label |
jnz .skip |
cmp byte[esi+11],$0F ; fat32 |
je .skip |
cmp byte[esi],$E5 ; erased |
je .skip |
mov eax,[esi+28] ; add file size |
add [d_ttsz],eax ; to folder size |
push ecx |
mov ecx,3 |
rep movsd ; copy name, attriputes |
mov [edi],ebp ; and block number |
add edi,4 |
add esi,20 |
inc [d_tcnt] ; increase folder files counter |
; cmp [d_tcnt],max_cnt |
; je .exit |
pop ecx |
jmp @f |
.skip: |
add esi,32 |
@@: |
loop .next_file |
cmp [d_tcnt],max_cnt |
je .exit |
inc ebp |
jmp .next_block |
.exit: |
pop edx |
push [d_ttsz] |
mov eax,[d_tcnt] |
cmp dl,0 |
jne ._02 |
mov [d_lcnt],eax |
pop [d_ltsz] |
jmp @f |
._02: |
mov [d_rcnt],eax |
pop [d_rtsz] |
@@: |
popad |
mov al,dl |
call mfar_sort |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
func execute_current_file |
pushad |
cmp [active_panel],0 |
jne ._00 |
mov esi,[d_lpos] |
shl esi,4 |
add esi,lstart |
mov edi,f_path0 |
mov ecx,f_plen0 |
jmp @f |
._00: |
mov esi,[d_rpos] |
shl esi,4 |
add esi,rstart |
mov edi,f_path1 |
mov ecx,f_plen1 |
@@: |
call get_file_info |
test byte[esi+11],FA_FOLDER |
jz .file |
cmp word[esi],'..' |
jne .enter_dir |
add edi,[ecx] |
dec edi |
@@: |
dec [f_plen1] |
cmp byte[edi],'/' |
je @f |
dec edi |
jmp @b |
@@: |
mov dword[edi],0 |
jmp @f |
.enter_dir: |
add edi,[ecx] |
push ecx edi |
mov byte[edi],'/' |
inc edi |
mov esi,file_info |
mov ecx,3 |
cld |
rep movsd |
mov dword[edi],0 |
pop esi ecx |
sub edi,esi |
add dword[ecx],edi |
mov [d_rpos],0 |
mov [d_rtop],0 |
@@: |
mov dl,[active_panel] |
call get_files_data |
call draw_path |
mov al,dl |
call draw_files |
jmp .exit |
.file: |
mov eax,[esi+8] |
shl eax,8 |
and eax,$FFFFFF00 |
or eax,$00000020 |
cmp eax,' ' |
jne .exit |
mov esi,edi |
mov eax,[ecx] |
mov edi,f_pathn |
call get_normal_path |
mov esi,f_pathn |
mov ecx,[len] |
dec ecx |
mov edi,f_info.path |
rep movsb |
mov byte[edi],'/' |
inc edi |
mov esi,file_info |
@@: |
movsb |
cmp byte[esi],0 |
je @f |
cmp byte[esi],' ' |
jne @b |
@@: |
mov byte[edi],0 |
mov dword[f_info],FS_EXECUTE |
mov dword[f_info+12],0 |
mcall MF_FSACCESS,f_info |
.exit: |
popad |
ret |
endf |
;------------------------------------------------------------------------------ |
;////////////////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
func delete_current_file |
pushad |
popad |
ret |
endf |
;------------------------------------------------------------------------------ |
;///// INCLUDES /////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
include 'mf-copy.inc' |
include 'mf-sort.inc' |
;------------------------------------------------------------------------------ |
;///// DATA /////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
align 4 |
f_size dd ? |
f_day db ? |
f_mnth db ? |
f_year dw ? |
d_lpos dd 0 |
d_ltop dd 0 |
d_lcnt dd 0 |
d_ltsz dd 0 |
d_rpos dd 0 |
d_rtop dd 0 |
d_rcnt dd 0 |
d_rtsz dd 0 |
d_tpos dd ? |
d_ttop dd ? |
d_tcnt dd ? |
d_ttsz dd ? |
f_info: |
dd 0 |
dd 0 |
dd ? |
dd read_area |
dd MEM_FOR_OS |
.path: |
rb 255 |
f_plen0 dd 5 |
f_plen1 dd 5 |
sz caption,'MFAR : PRE-ALPHA-8.1',0 |
sz fcfile,'MFAR DAT' |
sz p_hd,'/HD/1',0 |
sz p_rd,'/RD/1',0 |
ext0: |
db ' EXE COM BAT CMD' |
dd 0 |
ext1: |
db ' BMP GIF JPG PNG WMF' |
dd 0 |
ext2: |
db ' ASM INC' |
dd 0 |
;----- LANGUAGE-SPECIFIC STRINGS ----- |
include 'mf-lang.inc' |
;------------------------------------- |
f_name: rb 12 |
file_info: db ' . .' |
active_panel db 0 |
;--------------------------------- |
sel_color = $00008080 |
FPC = 18 |
MEM_FOR_OS = $48300 |
MEM_USED = $4C300 |
read_area = $48000 |
fdata_size = $40000-$300 |
max_cnt = fdata_size/32 |
lstart = $8000+$300 |
rstart = lstart+max_cnt*16 |
f_path0 = $8000 |
f_path1 = $8000+$100 |
f_pathn = $8000+$200 |
align 4 |
sc system_colors |
fc mfar_colors |
I_END: |
; 16 bytes per entry: |
; -> 8 bytes - name |
; -> 3 bytes - extension |
; -> 1 byte - attributes |
; -> 4 bytes - block number |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
/programs/other/outdated/mfar/trunk/mf-lang.inc |
---|
0,0 → 1,39 |
;------------------------------------------------------------------------------ |
;///// LOCALIZED STRINGS ////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
lsz lname,\ |
ru,'•',\ |
en,'Name',\ |
fr,'Nom',\ |
ge,'Name' |
lsz sort_kind,\ |
ru,'¨à',\ |
en,'nx',\ |
fr,'ne',\ |
ge,'ne' |
lsz btmkeys,\ |
ru,'®¬®éì ®«ì§ à®á¬ ¥¤ ªâ ®¯¨à ',\ |
ru,'¥à¥ ¯ª ¤ «¥ ®ä ë室',\ |
en,'Help UserMn View Edit Copy ',\ |
en,'RenMov MkFold Delete ConfMn Quit',\ |
fr,'Aide UserMn Vue Editer Copier ',\ |
fr,'RenDep CrÎeRp Efface ConfMn Quitter',\ |
ge,'Hilfe Menà Anzeig Bearb. Kopie ',\ |
ge,'UmbBew MkDir LÂsche Funkt. Ende' |
lsz sz_cancel,\ |
ru,'⬥ ',\ |
en,'Cancel',\ |
fr,'Annuler',\ |
ge,'Beenden' |
;---------- COPY DIALOG ---------- |
lsz sz_copy,\ |
ru,'®¯¨à®¢ âì "',\ |
en,'Copy "',\ |
fr,'Copier "',\ |
ge,'Kopiere "' |
lsz sz_copyto,\ |
ru,'" ¢:',\ |
en,'" to:',\ |
fr,'" vers:',\ |
ge,'" nach:' |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
/programs/other/outdated/mfar/trunk/mfar.inc |
---|
0,0 → 1,147 |
oX = 6 |
oY = 22+3 |
tW = 6 |
tH = 9 |
VK_TAB = 9 |
VK_RETURN = 13 |
VK_ESCAPE = 27 |
VK_F10 = 49 |
VK_F5 = 54 |
VK_LEFT = 176 |
VK_DOWN = 177 |
VK_UP = 178 |
VK_RIGHT = 179 |
VK_HOME = 180 |
VK_END = 181 |
VK_PGDOWN = 183 |
VK_PGUP = 184 |
VK_CTRLF3 = 212 |
VK_CTRLF4 = 213 |
FA_READONLY = 00000001b |
FA_HIDDEN = 00000010b |
FA_SYSTEM = 00000100b |
FA_LABEL = 00001000b |
FA_FOLDER = 00010000b |
FA_ARCHIVED = 00100000b |
struc mfar_colors { |
.background dd $00000080 |
.default dd $0000FFFF |
.system dd $00008080 |
.selection dd $00009090 |
.folder dd $00FFFFFF |
.executable dd $0000FF00 |
.bitmap dd $00FF00FF |
.source dd $00FF0000 |
.path dd $00C0C0C0 |
.pathbg dd $00000000 |
.keys dd $00000000 |
.keysbg dd $00008080 |
} |
struct mfar_colors |
macro __mov reg,a { |
if ~a eq |
mov reg,a |
end if |
} |
macro mcall a,b,c,d,e,f { |
__mov eax,a |
__mov ebx,b |
__mov ecx,c |
__mov edx,d |
__mov esi,e |
__mov edi,f |
int $40 |
} |
macro mcall1 a,b1,b2,c,d,e,f { |
__mov eax,a |
if (~b1 eq)|(~b2 eq) |
mov ebx,(b1)*65536+(b2) |
end if |
__mov ecx,c |
__mov edx,d |
__mov esi,e |
__mov edi,f |
int $40 |
} |
macro mcall2 a,b1,b2,c1,c2,d,e,f { |
__mov eax,a |
if (~b1 eq)|(~b2 eq) |
mov ebx,(b1)*65536+(b2) |
end if |
if (~c1 eq)|(~c2 eq) |
mov ecx,(c1)*65536+(c2) |
end if |
__mov edx,d |
__mov esi,e |
__mov edi,f |
int $40 |
} |
macro sz name,[data] { |
common |
if used name |
label name |
end if |
forward |
if used name |
db data |
end if |
common |
if used name |
.size = $-name |
end if |
} |
macro lsz name,[lng,data] { |
common |
if used name |
label name |
end if |
forward |
if (used name)&(lang eq lng) |
db data |
end if |
common |
if used name |
.size = $-name |
end if |
} |
macro mmov reg,a1,a2 { |
mov reg,(a1)*65536+a2 |
} |
macro madd reg,a1,a2 { |
add reg,(a1)*65536+a2 |
} |
macro msub reg,a1,a2 { |
sub reg,(a1)*65536+a2 |
} |
macro jmpe reg,def,[val,lab] { |
forward |
cmp reg,val |
je lab |
common |
if ~def eq |
jmp def |
end if |
} |
macro func name { |
if used name |
label name |
} |
macro endf { |
end if |
} |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
/programs/other/outdated/mfar/trunk/readme.txt |
---|
0,0 → 1,80 |
; MFAR pre-alpha 8.1 |
; 2003-2004 (C) Semenyako Mike a.k.a. mike.dld |
; e-mail: mike.dld@tut.by |
;------------------------------------------------------------------------------ |
;///// ENGLISH //////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
---[ ATTENTION ]--------------------------------------------------------------- |
This MFAR version is far from being RELEASE! |
So, use it carefully, paying special attention to the new features. |
---[ ABOUT ]------------------------------------------------------------------- |
MFAR was intended as SYSTREE-alternative & at the same time as file-manager |
with well-known & handy interface for MenuetOS. It'll be look like FAR |
(farmanager.com) which i really like BTW. |
---[ FEATURES ]---------------------------------------------------------------- |
- displaying RD (left) & HD (right) file structure |
- color highlighting for files (depending on their extensions) |
- sotring (by name or extension) |
- selected file info: date, size |
- MeOS apps execution |
---[ TODO ]-------------------------------------------------------------------- |
- copying (moving), deleting files |
- disk selection |
- other sort types |
- not only apps execution |
- ... |
---[ HOTKEYS ]----------------------------------------------------------------- |
Up, Down, Left, Right, Home, End - if you worked in any DOS-based file- |
manager (NC, VC, DN, ...), even a few minutes, you may know that this |
keys direct the caret (light pen) |
F5 - copy !FILE! from one panel to another (in development) |
F10 - exit program |
Ctrl+F3 - sort by name |
Ctrl+F4 - sort by extension |
;------------------------------------------------------------------------------ |
;///// //////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
---[ ¨¬ ¨¥ ]---------------------------------------------------------------- |
âã ¢¥àá¨î MFAR ¨ª ª ¥«ì§ï áç¨â âì ५¨§®¬! |
à®£à ¬¬ 室¨âáï ¢ à §à ¡®âª¥ ¨ ï ®ç¥ì ᮦ «¥î ® ⮬, çâ® ¥ ¢ ᨫ å |
¯®ª çâ® ¯à¥¤áâ ¢¨âì ¬ ¯®«®æ¥ë© ä ©«-¬¥¥¤¦¥à, å®âï ¡ë ¯à¨¡«¨§¨â¥«ì® |
áà ¢¨¬ë© ¯® äãªæ¨® «ìë¬ ¢®§¬®¦®áâï¬ á «®£¨ç묨 ¯à®¥ªâ ¬¨ ¯®¤ *nix |
¨ *dows. |
---[ ¯à®£à ¬¬¥ ]------------------------------------------------------------- |
MFAR ¡ë« § ¤ã¬ ª ª «ìâ¥à ⨢ SYSTREE ¨ ®¤®¢à¥¬¥® ª ª ä ©«-¬¥¥¤¦¥à |
á® § ª®¬ë¬ ¨ 㤮¡ë¬ ¨â¥à䥩ᮬ ¯®¤ MenuetOS. § §¢ ¨ï ¬®¦® ¤®£ ¤ âìáï, |
çâ® ¢¥è¨© ¢¨¤ ¯à®£à ¬¬ë ¡ã¤¥â ¥ ®á®¡® ®â«¨ç âìáï ®â FAR' (farmanager.com), |
®ç¥ì, ªáâ â¨, ¬®î «î¡¨¬®£® ¨ 㢠¦ ¥¬®£® ¯à®¥ªâ . |
---[ ⮠ᤥ« ® ]------------------------------------------------------------- |
- ®â®¡à ¦¥¨¥ ä ©«®¢®© áâàãªâãàë ®¡à § (á«¥¢ ) ¨ (á¯à ¢ ) |
- ¯®¤á¢¥âª ¨¬¥ ä ©«®¢ à §ë¬¨ 梥⠬¨ (¢ § ¢¨á¨¬®á⨠®â ä®à¬ â ) |
- á®àâ¨à®¢ª (¯® ¨¬¥¨ ¨«¨ à áè¨à¥¨î) |
- à §¬¥à ¨ ¤ â ᮧ¤ ¨ï (¨§¬¥¥¨ï) ¤«ï ¢ë¤¥«¥®£® ä ©« |
- § ¯ã᪠¨á¯®«ï¥¬ëå ä ©«®¢ |
---[ â® å®â¥«®áì ¡ë ᤥ« âì ]------------------------------------------------- |
- ª®¯¨à®¢ ¨¥ (¯¥à¥¬¥é¥¨¥), 㤠«¥¨¥ ä ©«®¢ |
- ¢ë¡®à ªâ¨¢®£® ¤¨áª ¤«ï ¯ ¥«¥© |
- ¤à㣨¥ ¢¨¤ë á®àâ¨à®¢®ª |
- § ¯ã᪠¥ ⮫쪮 ¨á¯®«ï¥¬ëå ä ©«®¢ |
- ... |
---[ ®ç¥â ¨ï ª« ¢¨è ]-------------------------------------------------------- |
Up, Down, Left, Right, Home, End - ªâ® å®âï ¡ë à § à ¡®â « ¢ ®¢áª®¬ |
ä ©«-¬¥¥¤¦¥à¥ (NC, VC, DN, ...) § ¥â, çâ® á ¯®¬®éìî íâ¨å ª« ¢¨è ¬®¦® |
ã¯à ¢«ïâì ¯®«®¦¥¨¥¬ ªãàá®à (ᢥ⮢®£® ¯¥à ) |
F5 - ª®¯¨à®¢ âì ä ©« ¨§ ®¤®© ¯ ¥«¨ ¢ ¤àã£ãî (¢ à §à ¡®âª¥) |
F10 - ¢ë室 ¨§ ¯à®£à ¬¬ë |
Ctrl+F3 - á®àâ¨à®¢ âì ¯® ¨¬¥¨ |
Ctrl+F4 - á®àâ¨à®¢ âì ¯® à áè¨à¥¨î |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
/programs/other/outdated/sysxtree/trunk/Tupfile.lua |
---|
0,0 → 1,2 |
if tup.getconfig("NO_FASM") ~= "" then return end |
tup.rule("sysxtree.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "sysxtree") |
/programs/other/outdated/sysxtree/trunk/sysxtree.asm |
---|
0,0 → 1,2688 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
; ; |
; SYSTEM X-TREE BROWSER ; |
; ; |
; Author: Pavlushin Evgeni waptap@mail.ru ; |
; site: www.deck4.narod.ru ; |
; ; |
; Compile with FASM for MenuetOS ; |
; ; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;Bug report +bug deleted -bug not deleted |
;show/fade del notwork+ |
;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 |
;74Ver scroll bug deleted |
;75Ver hd partition fast change button. Add bmp,txt,exec,asm and inc icons. |
; sort type in headmenu bug del |
;78Ver directory extension bug fix by Asko Vuori |
;79Ver Asko Vuori volume label add and "put in command line" bug fix |
;80Ver prompt edit fatal bug deleted, antiflick when move list up/down |
;81Ver Save Dialog bug deleted |
;82Ver Rewritten to function 70. Corrected work with scrollbar. |
;83Ver CD-ROM support |
;84Ver URL line editor corrected |
;1560000 bytes memory! |
;****************************************************************************** |
use32 |
org 0x0 |
db 'MENUET01' ; 8 byte id |
dd 0x01 ; header version |
dd START ; program start |
dd I_END ; program image size |
dd RAM_END ; memory |
dd RAM_END ; stack |
dd param_area ,0x0 ; param,icon |
; dd 0,0 |
;****************************************************************************** |
include '../../../macros.inc' ; |
include 'ascl.inc' |
include 'ascgl.inc' |
START: ; start of execution |
; //// Willow |
; mov eax,58 |
; mov ebx,MRUfile |
; mcall |
; //// Willow |
mcall 18,11,1,table_area |
cmp [edx+2],byte 0 |
je no_hdpartition_on_hd0 |
mov [hdimg1], aHD0 |
no_hdpartition_on_hd0: |
cmp [edx+3],byte 0 |
je no_hdpartition_on_hd1 |
mov [hdimg2], aHD1 |
no_hdpartition_on_hd1: |
cmp [edx+4],byte 0 |
je no_hdpartition_on_hd2 |
mov [hdimg3], aHD2 |
no_hdpartition_on_hd2: |
cmp [edx+5],byte 0 |
je no_hdpartition_on_hd3 |
mov [hdimg4], aHD3 |
no_hdpartition_on_hd3: |
test byte [edx+1], 80h |
jz @f |
mov [hdimg1], aCD0 |
mov [hdimg1+4], 'CD-R' |
mov [hdimg1+8], 'OM ' |
@@: |
test byte [edx+1], 20h |
jz @f |
mov [hdimg2], aCD1 |
mov [hdimg2+4], 'CD-R' |
mov [hdimg2+8], 'OM ' |
@@: |
test byte [edx+1], 8 |
jz @f |
mov [hdimg3], aCD2 |
mov [hdimg3+4], 'CD-R' |
mov [hdimg3+8], 'OM ' |
@@: |
test byte [edx+1], 2 |
jz @f |
mov [hdimg4], aCD3 |
mov [hdimg4+4], 'CD-R' |
mov [hdimg4+8], 'OM ' |
@@: |
mov eax,40 |
mov ebx,0100111b |
mcall |
cmp byte [param_area],0 ;test parameters line |
jne no_brow ;it's dialog |
mov [browser], 1 ;it's browser |
jmp no_dlg |
no_brow: |
mov al,byte [param_area+5] |
mov [dlg_type],al |
mov eax,9 |
mov ebx,procinfo |
mov ecx,-1 |
mcall |
mov eax,dword [procinfo+30] |
mov edi,MYPID+4-1 |
mov ecx,4 |
mov ebx,10 |
cld |
new_d: |
xor edx,edx |
div ebx |
add dl,'0' |
mov [edi],dl |
dec edi |
loop new_d |
movzx eax,byte [param_area] |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [param_area+1] |
add eax,ebx |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [param_area+2] |
add eax,ebx |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [param_area+3] |
add eax,ebx |
sub eax,48 |
mov ecx,eax ;pid to ecx |
mov eax,60 |
mov ebx,2 |
mov edx,MYPID |
mov esi,4 |
mcall |
no_dlg: |
giftoimg but_file,tempimg |
;************************ |
; Get images |
;************************ |
mov eax,0 ;x |
mov ebx,0 ;y |
mov esi,286 ;xs |
mov edi,16 ;ys |
mov ecx,tempimg ;src |
mov edx,butimg ;dest |
call getimgproc |
mov eax,288 |
mov esi,60 |
mov edx,logoimg ;dest |
call getimgproc |
mov eax,0 ;x |
mov ebx,16 ;y |
mov esi,51 ;xs |
mov edi,esi ;ys |
mov edx,logoinfimg ;dest |
call getimgproc |
mov eax,51 ;x |
mov esi,8 ;xs |
mov edi,9 ;ys |
mov edx,upsb ;dest |
call getimgproc |
mov eax,51+8 ;x |
mov edx,dnsb ;dest |
call getimgproc |
mov eax,51+16 ;x |
mov ebx,16 ;y |
mov esi,12 ;xs |
mov edi,9 ;ys |
mov ecx,tempimg ;src |
mov edx,hdico ;dest |
mov ebp,10 |
loogetimg: |
call getimgproc |
add edx,9*12*3+8 |
add eax,12 |
dec ebp |
jnz loogetimg |
call read_directory |
; call convertation |
red: |
call draw_window ; at first, draw the window |
still: |
mov eax,9 |
mov ebx,procinfo |
mov ecx,-1 |
mcall |
wtevent red,key,button |
scrolltest: |
mov eax,37 |
mov ebx,2 |
mcall |
dec eax |
jne still |
scrl: |
mov eax,37 |
mov ebx,1 |
mcall |
movzx ebx, ax ; y |
shr eax, 16 ; x |
mov ebp,eax |
sub ebp,[listx] ;[procinfo.box.width] |
sub ebp,[listxsize] |
add ebp,[scrollsize] |
cmp ebp,dword [scrollsize] ;8 |
jae menu_test ; still |
lea ebp, [ebx-scrollbutsize] |
sub ebp, [listy] ; up scroll |
jl menu_test |
mov ecx, [listysize] |
sub ecx, 2*scrollbutsize |
mov eax, [scroll_height] |
cmp ebp, ecx |
jge menu_test |
sub ecx, eax |
shr eax, 1 |
sub ebp, eax |
jge @f |
xor ebp, ebp |
@@: |
cmp ebp, ecx |
jl @f |
mov ebp, ecx |
@@: |
xor edx, edx |
mov eax, [listysize] |
sub eax, 2 |
mov ebx, 10 |
div ebx |
mov ebx, eax |
cmp ebx, [listsize] |
jae notusescrl |
mov eax, [listsize] |
sub eax, ebx |
mul ebp |
div ecx |
cmp eax, [filecursor] |
jz still |
mov [filecursor], eax |
jmp usescrl |
notusescrl: |
cmp [filecursor], 0 |
jz still |
mov [filecursor],0 ;ebp |
usescrl: |
mov [flick],1 |
jmp anti_flick ;red |
menu_test: |
cmp [pmenu_draw],1 ;if menu is show, update all |
jne still |
mov [pmenu_draw],0 |
jmp red ;update all window |
;this function not use in dialog when poup menu's is not used |
;in dialog's |
;=================== |
; Test keyboard |
;=================== |
key: ; key |
mov eax,2 |
mcall |
cmp dword [focus],0 |
jne con_edit |
cmp ah,key_Up |
jne no_upk |
mov ebx,1 |
jmp up |
no_upk: |
cmp ah,key_Down |
jne no_downk |
mov ebx,1 |
jmp down |
no_downk: |
cmp ah,key_PgUp |
jne no_pgup |
mov ebx,10 |
jmp up |
no_pgup: |
cmp ah,key_PgDown |
jne no_pgdown |
mov ebx,10 |
jmp down |
no_pgdown: |
cmp ah,key_Enter |
je kfad |
cmp ah,key_Bspace |
je back |
cmp ah,key_F2 |
je viewset |
cmp ah,key_F3 |
je textopen |
cmp ah,key_F5 |
je copy_to_clip |
cmp ah,key_F6 |
je paste_from_clip |
cmp ah,key_F11 |
je edit_prompt |
cmp ah,key_F12 |
je update |
jmp still |
; test input string |
con_edit: |
cmp ah,key_Enter |
jne no_con_ent |
not [focus] |
jmp savetest |
; jmp update |
no_con_ent: |
cmp ah,key_Left |
jne no_con_left |
cmp [cursor], 0 |
jz still |
dec [cursor] |
mov [flick],2 |
jmp anti_flick ;red |
no_con_left: |
cmp ah,key_Right |
jne no_con_right |
mov eax, [cursor] |
cmp byte [path+eax], 0 |
jz still |
inc [cursor] |
mov [flick],2 |
jmp anti_flick ;red |
no_con_right: |
cmp ah,key_Bspace |
jne no_con_bspace |
mov ebp, [cursor] |
test ebp, ebp |
jz still |
lobsp: |
mov bl,byte [path+ebp] |
mov byte [path+ebp-1],bl |
inc ebp |
cmp ebp,1024 |
jne lobsp |
dec [cursor] |
mov [flick],2 |
jmp anti_flick ;red |
no_con_bspace: |
mov ecx,[cursor] |
mov ebp,1022 |
cmp byte [path+ebp], 0 |
jnz still |
losx: |
cmp ebp, ecx |
jbe @f |
mov bl,byte [path+ebp] |
mov byte [path+ebp+1],bl |
dec ebp |
jmp losx |
@@: |
mov byte [path+ebp],ah |
inc dword [cursor] |
mov [flick],2 |
jmp anti_flick |
;---------------------------- |
;Test on mouse button |
;----------------------------- |
button: ; button |
mov eax,17 |
mcall |
cmp ah,2 ;Edit prompt line? |
je edit_prompt |
cmp ah,4 |
jne no_filelist |
mousetest: |
mov eax,37 |
mov ebx,1 |
mcall |
mov ebx,eax |
shr eax,16 ;x |
and ebx,0xffff ;y |
sub ebx,[listy] ;80 |
mov [mousey],ebx |
mov ecx,[listx] |
cmp eax,ecx |
jl still |
add ecx,[listxsize] |
cmp eax,ecx |
jg still |
filexadd: |
; Enter in directory |
file_add: |
mov edx,0 ;for div correct work div |
mov eax,dword [mousey] |
mov ebx,10 |
div ebx |
add eax,[filecursor] |
jmp no_kfad |
kfad: |
mov eax,[filecursor] |
no_kfad: |
mov ebx,27 |
mul ebx |
lea ebp,[convinfo+eax] |
mov esi,[ebp] |
cmp esi,-1 |
jz still |
mov edi,paramtest ;clear param string |
mov ecx,1024/4 |
xor eax,eax |
rep stosd |
mov edi, path |
mov ecx, 1024 |
repnz scasb |
dec edi |
cmp [ebp+15], dword 'FOL ' |
jnz openf |
; open directory - append its name to path |
cmp ecx, 2 |
jb still |
push edi |
mov al, '/' |
stosb |
dec ecx |
@@: |
lodsb |
stosb |
test al, al |
jz @f |
dec ecx |
jnz @b |
; name is too long - do not do anything |
pop edi |
xor eax, eax |
mov ecx, path+1024 |
sub ecx, edi |
rep stosb |
jmp still |
@@: |
sub edi, path+1 |
mov [cursor], edi |
pop edi |
; name appended, now read new directory |
mov [filecursor],0 |
call read_directory |
;; call convertation |
call draw_window |
jmp still |
;Savetest |
savetest: |
cmp byte [dlg_type],'S' |
jne still |
; always force open file - this is better |
; because there exists files without extension and folders with extension |
jmp openf |
; mov ecx,100 |
;savetestloop: |
; cmp [path+ecx],byte 0 |
; je next_byte |
; cmp [path+ecx],byte 32 |
; je next_byte |
; cmp [path+ecx],byte '.' |
; je openf ;it's file |
;; cmp [path+ecx],byte '/' |
;; je no_save ;it's dir |
;next_byte: |
; dec ecx |
; jnz savetestloop |
; jmp still |
;Open/Run file |
openf: |
push esi edi |
mov esi, path |
mov edi, paramtest |
mov ecx, 1024/4 |
rep movsd |
pop edi esi |
add edi, paramtest-path |
cmp dword [focus],0 ;if prompt line with focus no add file name from frame |
jne file_set |
cmp edi, paramtest+1022 |
jae still |
mov al, '/' |
stosb |
@@: |
lodsb |
stosb |
test al, al |
jz file_set |
cmp edi, paramtest+1024 |
jb @b |
jmp still |
file_set: |
cmp [browser],0 |
jne is_brow |
movzx eax,byte [param_area] |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [param_area+1] |
add eax,ebx |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [param_area+2] |
add eax,ebx |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [param_area+3] |
add eax,ebx |
sub eax,48 |
mov ecx,eax ;pid to ecx |
mov eax,60 |
mov ebx,2 |
mov edx,paramtest |
mov esi,1024 |
mcall |
jmp exit |
is_brow: |
; cmp [convinfo+edi+26],dword 'Fvol' |
; je edit |
; find extension |
mov eax, paramtest+1023 |
@@: |
dec eax |
cmp byte [eax+1], 0 |
jz @b |
@@: |
cmp byte [eax], '/' |
jz .noext |
cmp byte [eax], '.' |
jz .ext |
dec eax |
cmp eax, paramtest |
jae @b |
.noext: |
; file has no extension |
; xor ebx, ebx |
jmp execute |
.ext: |
inc eax |
; eax points to extension |
cmp byte [eax], 0 |
jz .noext |
mov ecx, dword [eax] |
and ecx, not 0x20202020 |
mov ebx, kiv |
cmp ecx, 'JPG' |
jz run |
cmp ecx, 'JPEG' ; note that it will select also *.JPEG* |
jz run |
cmp ecx, 'GIF' |
jz run |
cmp ecx, 'BMP' |
jz run |
cmp ecx, 'PNG' |
jz run |
cmp ecx, 'ICO' |
jz run |
cmp ecx, 'CUR' |
jz run |
mov ebx, ac97 |
cmp ecx, 'WAV' |
jz run |
cmp ecx, 'MP3' |
jz run |
cmp ecx, 'XM' |
jz run |
mov ebx, midamp |
cmp ecx, 'MID' |
jz run |
mov ebx, htmlv |
cmp ecx, 'HTM' |
jz run |
cmp ecx, 'HTML' |
jz run |
mov ebx, rtfread |
cmp ecx, 'RTF' |
jz run |
mov ebx, editor |
cmp ecx, 'ASM' |
jz run |
cmp ecx, 'TXT' |
jz run |
cmp ecx, 'INC' |
jz run |
cmp ecx, 'INI' |
jz run |
cmp ecx, 'LOG' |
jz run |
cmp ecx, 'CONF' |
jz run |
mov ebx, life2 |
cmp ecx, 'LIF' |
jz run |
mov ebx, view3ds |
cmp ecx, '3DS' and not 0x20202020 |
jz run |
jmp still |
execute: |
mov ebx, fileinfo_start |
and dword [ebx+8], 0 ; no parameters |
mov dword [ebx+21], paramtest ; program name |
.do: |
mov eax, 70 |
mcall |
jmp still |
run: |
mov [fileinfo_name], ebx ; program name |
mov ebx, fileinfo_start |
mov dword [ebx+8], paramtest ; parameters |
jmp execute.do |
no_filelist: |
cmp ah,5 ;OPEN/SAVE button |
je kfad |
cmp ah,6 ;Scroll up |
jne no_scrlup |
mov ebx,1 |
jmp up |
no_scrlup: |
cmp ah,7 ;Scroll down |
jne no_scrldown |
mov ebx,1 |
jmp down |
no_scrldown: |
cmp ah,8 |
jne no_update |
update: |
call read_directory |
; call convertation |
; mov [filecursor],0 |
call draw_window |
no_update: |
cmp ah,9 |
jne no_textopen |
textopen: |
mov eax, 27 |
mul [filecursor] |
cmp dword [eax+convinfo+15], 'FOL ' |
jz still |
push eax |
mov esi, path |
mov edi, paramtest |
@@: |
lodsb |
test al, al |
jz @f |
stosb |
jmp @b |
@@: |
mov al, '/' |
stosb |
pop eax |
mov esi, [eax+convinfo] |
cmp esi, -1 |
jz still |
@@: |
lodsb |
stosb |
test al, al |
jz @f |
cmp edi, paramtest+1024 |
jb @b |
jmp still |
@@: |
mov ebx, editor |
jmp run |
no_textopen: |
cmp ah,11 |
jne no_view |
viewset: |
inc [viewmode] |
cmp [viewmode], 4 |
jb @f |
mov [viewmode], 0 |
@@: |
call read_directory |
; call convertation |
mov [filecursor],0 |
call draw_window |
jmp still |
no_view: |
cmp ah,12 ;move back |
jne no_back |
back: |
mov edi, path+1024 |
mov ecx, edi |
@@: |
dec edi |
cmp byte [edi], '/' |
jz @f |
cmp edi, path |
ja @b |
jmp still |
@@: |
sub ecx, edi |
lea eax, [edi-path] |
mov [cursor], eax |
xor eax, eax |
rep stosb |
mov [filecursor],0 |
call read_directory |
; call convertation |
call draw_window |
jmp still |
no_back: |
cmp ah,13 ;string up? |
jne no_up |
mov ebx,1 ;step |
up: |
mov [downstop],0 |
sub [filecursor],ebx |
cmp [filecursor],0 |
jnl cr_ok |
mov [filecursor],0 |
cr_ok: |
jmp draw_wd |
no_up: |
cmp ah,14 ;string down? |
jne no_dn |
mov ebx,1 ;step |
down: |
cmp [downstop],1 |
je no_dn |
add [filecursor],ebx |
jmp draw_wd |
no_dn: |
cmp ah,15 |
jne no_copyclip ;copy to clipboard |
copy_to_clip: |
mov eax, 27 |
mul [filecursor] |
cmp dword [convinfo+eax+15], 'FOL ' |
jz still |
push eax |
mov esi, path |
mov edi, paramtest |
@@: |
lodsb |
test al, al |
jz @f |
stosb |
jmp @b |
@@: |
pop eax |
mov esi, [convinfo+eax] |
cmp esi, -1 |
jz still |
mov al, '/' |
stosb |
@@: |
lodsb |
stosb |
test al, al |
jz @f |
cmp edi, paramtest+1024 |
jb @b |
jmp still |
@@: |
sub edi, paramtest+1 |
mov ebx, clipfile_info |
mov byte [ebx], 2 |
mov [ebx+12], edi |
mov eax, 70 |
mcall |
jmp still |
no_copyclip: |
cmp ah,16 |
jne no_clippaste |
paste_from_clip: |
mov ebx, clipfile_info |
mov byte [ebx], 0 |
mov dword [ebx+12], 1023 |
mov eax, 70 |
mcall |
cmp ebx, 0 |
jle still |
mov byte [paramtest+ebx], 0 |
; OS allows only 256 symbols in command line |
cmp ebx, 250 |
jae still |
; we use Pascal-style strings for /RD/1/COPYR |
; source file |
mov edi, copyr_param |
mov al, bl |
stosb |
mov ecx, ebx |
mov esi, paramtest |
rep movsb |
; destination path |
inc edi |
mov ebp, edi |
mov esi, path |
@@: |
cmp edi, copyr_param+255 |
jae still |
lodsb |
test al, al |
jz @f |
stosb |
jmp @b |
; destination file name |
@@: |
dec ebx |
jz still |
cmp byte [paramtest+ebx], '/' |
jnz @b |
lea esi, [paramtest+ebx] |
@@: |
lodsb |
test al, al |
jz @f |
stosb |
cmp edi, copyr_param+255 |
jae still |
jmp @b |
@@: |
mov byte [edi], 0 |
sub edi, ebp |
mov eax, edi |
mov [ebp-1], al |
; display |
cmp [browser], 1 |
jne no_outpath |
mov eax,4 ; function 4 : write text to window |
mov ebx,10*65536+67 ; [x start] *65536 + [y start] |
mov ecx,0x00000000 ;[sc.grab_text] ; color of text RRGGBB |
mov edx, copyr_param+1 |
movzx esi, byte [edx-1] |
mcall |
mov ebx,250*65536+67 ; [x start] *65536 + [y start] |
mov ecx,0x00000000 ;[sc.grab_text] ; color of text RRGGBB |
mov edx, ebp |
mov esi, edi |
mcall |
no_outpath: |
; run COPYR |
mov eax, 70 |
mov ebx, copyr_run |
mcall |
delay 50 ;wait recoed file |
jmp update ;still |
no_clippaste: |
cmp ah,19 ;Delete from floppy |
jne no_delt |
delete_file: |
; OS now do not support file delete |
jmp still |
no_delt: |
cmp ah,20 ;I - Help |
je help_scr |
cmp ah,22 |
jne no_headfile |
mov [drawhf],1 |
call draw_window |
mov [drawhf],0 |
mov [pmenu_draw],1 |
jmp still |
no_headfile: |
cmp ah,23 |
jne no_headview |
mov [drawhv],1 |
call draw_window |
mov [drawhv],0 |
mov [pmenu_draw],1 |
jmp still |
no_headview: |
cmp ah,24 |
jne no_headinfo |
mov [drawhi],1 |
call draw_window |
mov [drawhi],0 |
mov [pmenu_draw],1 |
jmp still |
no_headinfo: |
;FILE MENU |
cmp ah,30 |
je kfad |
cmp ah,31 |
je copy_to_clip ;Copy |
cmp ah,32 |
je paste_from_clip ;Paste |
cmp ah,33 |
je delete_file ;Delte |
cmp ah,34 |
je textopen ;Edit in Tinypad |
cmp ah,37 |
je exit |
;VIEW MENU |
cmp ah,40 ;Sort by name |
jne no_sn |
mov [viewmode], 0 |
jmp update |
no_sn: |
cmp ah,41 ;Sort by extension |
jne no_se |
mov [viewmode], 1 |
jmp update |
no_se: |
cmp ah,42 ;Sort by size |
jne no_ss |
mov [viewmode], 2 |
jmp update |
no_ss: |
cmp ah,43 ;Sort by date |
jne no_sd |
mov [viewmode], 3 |
jmp update |
no_sd: |
;HELP MENU |
cmp ah,50 ;Help? |
je help_scr |
cmp ah,51 ;Info? |
je info_scr |
cmp ah,1 ; test on exit button |
je exit |
jmp still |
exit: |
; //// Willow |
; mov eax,58 |
; mov ebx,MRUfile |
; mov dword[ebx+8],255 |
; inc dword[ebx] |
; mcall |
; //// Willow |
mov eax,-1 |
mcall |
draw_wd: |
; call draw_window |
; jmp still |
mov [flick],1 |
jmp anti_flick |
edit_prompt: |
not [focus] |
jmp red |
help_scr: |
mov esi,14 |
mov ebp,help_text |
jmp screen |
info_scr: |
mov esi,6 |
mov ebp,info_text |
jmp screen |
screen: |
cmp [browser], 1 ;it's browser? |
jne dialogscr |
mov eax,[procinfo.box.height] |
sub eax,90 |
drawfbox 40,76,300,eax,0x00000000 |
mov eax,[procinfo.box.height] |
sub eax,92 |
drawfbox 41,77,298,eax,0x00ffffff |
mov edi,esi ;14 |
mov ebx,(41+26)*65536+(77+20) |
mov ecx,cl_Black |
mov edx,ebp ;help_text |
jmp outlab |
dialogscr: |
mov eax,[procinfo.box.height] |
sub eax,84 |
drawfbox 16,54,270,eax,0x00000000 |
mov eax,[procinfo.box.height] |
sub eax,86 |
drawfbox 17,55,268,eax,0x00ffffff |
mov edi,esi ;14 |
mov ebx,(17+10)*65536+(55+1) |
mov ecx,cl_Black |
mov edx,ebp ;help_text |
outlab: ;out labels |
mov eax,4 |
mov esi,40 |
helploo: |
mcall |
add ebx,11 |
add edx,40 |
dec edi |
jnz helploo |
setimg 48,84,logoinfimg |
jmp still |
getimgproc: |
pushad |
mov dword [edx],esi ;xs |
mov dword [edx+4],edi ;ys |
mov ebp,eax |
mov eax,dword [ecx] ;getx size |
push edx |
push ecx |
lea ecx,[eax+2*eax] |
mul ebx |
add eax,ebp ;x |
mov edx,ecx |
lea eax,[eax+2*eax] ;eax=offset on imsrc |
mov ebp,esi ;xs |
mov ebx,edi ;ys |
pop edi |
lea esi,[eax+8+edi] |
pop edi |
add edi,8 |
cld |
cyc: |
push esi |
lea ecx, [ebp+ebp*2] |
rep movsb |
pop esi |
add esi,edx |
dec ebx |
jne cyc |
popad |
ret |
iglobal |
;HELP TEXT |
help_text: |
;0123456789012345678901234567890123456789 |
db ' ~~~~~ SYSTEM X-TREE ~~~~~ ' |
db ' HELP ' |
db ' ' |
db ' ' |
db 'F2 - CHANGE SORTMODE (name,ext,size,dat)' |
db 'F3 - VIEW file in tinypad ' |
db 'F5 - COPY FILE to clipboard ' |
db 'F6 - PASTE FILE from clipboard ' |
db 'F11- EDIT PROMPT string ' |
db 'F12- UPDATE directory sources ' |
db ' ' |
db 'Enter - input to directory ' |
db 'Backspace - back to previos directory ' |
db 'PageDn/PageUp, Up/Down - move cursor ' |
info_text: |
db ' ~~~~~ SYSTEM X-TREE ~~~~~ ' |
db ' INFO 84 Ver ' |
db ' ' |
db ' Create by Pavlushin Evgeni ' |
db 'with ASCL library special for Kolibri OS' |
db ' www.deck4.narod.ru waptap@mail.ru ' |
endg |
; ********************************************* |
; ******* WINDOW DEFINITIONS AND DRAW ******** |
; ******** FILE BROWSER / DIALOG ********* |
;draw_browser_window: |
draw_window: |
; mov eax,9 |
; mov ebx,procinfo |
; mov ecx,-1 |
; mcall |
; mov eax,[procinfo.box.width] |
; cmp eax,66 |
; jg temp12345 |
; ret |
; temp12345: |
mcall 48, 3, sc, sizeof.system_colors |
mov eax,[sc.work_button] |
mov [b_color],eax |
mcall 12, 1 |
;Window |
xor eax,eax ; function 0 : define and draw window |
cmp [browser], 1 ;it's browser |
jne nob1 |
mov ebx,140*65536+400 ; [x start] *65536 + [x size] |
mov ecx,160*65536+280 ; [y start] *65536 + [y size] |
jmp isb1 |
nob1: |
mov ebx,140*65536+320 ; [x start] *65536 + [x size] |
mov ecx,260*65536+240 ; [y start] *65536 + [y size] |
isb1: |
; mov edx,[sc.work] ; color of work area RRGGBB |
or edx,0x13ffffff |
mcall |
mcall 12, 2 ; end of window redraw |
;Get proc info |
mov eax,9 |
mov ebx,procinfo |
mov ecx,-1 |
mcall |
mov eax,[procinfo.box.width] |
cmp eax,66 |
jg @f |
.ret: |
ret |
@@: |
cmp [procinfo.box.height], 0x70 |
jl .ret |
cmp [browser], 1 ;it's browser |
jne nob9 |
mov [listx],120 |
; mov eax,[procinfo.box.width] |
sub eax,127;[listx]+7 |
cmp eax,10 |
jl .ret |
mov [listxsize],eax |
mov [listy],73 |
mov eax,[procinfo.box.height] |
sub eax,73+7;[listy]+7 |
mov [listysize],eax |
jmp isb9 |
nob9: |
mov [listx],10 |
; mov eax,[procinfo.box.width] |
sub eax,17 ;[listx]+7 |
mov [listxsize],eax |
mov [listy],54 |
mov eax,[procinfo.box.height] |
sub eax,54+34;[listy]+34 |
mov [listysize],eax |
isb9: |
;Draw only browser components |
cmp [browser], 1 ;it's browser |
jne nob2 |
mov eax,[sc.grab_text] ; color of text RRGGBB |
or eax,0x10000000 |
mcall 71,1,title_browser |
;Draw buttons headers |
mov eax,8 |
mov ebx,8*65536+(6*8-1) ;start pos x |
mov ecx,23*65536+10 ;start pos y |
mov edx,22;+1000000000000000000000000000000b ;spoke butt |
mov edi,3 ;draw 13 button's |
mov esi,0x00339933 |
mcall |
dec edi |
nexthbut: |
add ebx,(6*8)*65536 |
inc edx |
mcall |
dec edi |
jnz nexthbut |
;File STRING |
glabel 8,25,' FILE VIEW INFO ', cl_White ;Black |
;BlackLine |
mov eax,[procinfo.box.width] |
sub eax,10 |
drawfbox 5,35, eax, 1, cl_Black |
;BlackLine2 |
mov eax,[procinfo.box.width] |
sub eax,10 |
drawfbox 5,68, eax, 1, cl_Black |
;BlackLine2 vertical |
; mov eax,[procinfo.box.height] |
; sub eax,69+4 |
; drawfbox 115, 69, 1, eax, cl_Black |
;Set logo img |
setimg 34,88,logoinfimg |
glabel 20,165,'SYSTEM X-TREE',cl_Black |
add ebx,10 |
glabel ,,'FOR KolibriOS', |
add ebx,9*65536+20 |
glabel ,,'welcome to',cl_Green |
add ebx,-15*65536+10 |
glabel ,,'www.kolibrios.org',cl_Green |
;Draw head->file buttons |
cmp [drawhf],1 |
jne no_drawhf |
mov ebx,8*65536+6*12 ;start pos x |
mov ecx,35*65536+10 ;start pos y |
mov edx,30 ;spoke butt |
mov edi,8 ;draw 4 button's |
mov esi,cl_Grey |
call menubutton |
no_drawhf: |
;Draw head->view buttons |
cmp [drawhv],1 |
jne no_drawhv |
mov ebx,(8+6*8)*65536+6*12 ;start pos x |
mov ecx,35*65536+10 ;start pos y |
mov edx,40 ;spoke butt |
mov edi,4 ;draw 4 button's |
mov esi,cl_Grey |
call menubutton |
no_drawhv: |
;Draw head->info buttons |
cmp [drawhi],1 |
jne no_drawhi |
mov ebx,(8+12*8)*65536+6*12 ;start pos x |
mov ecx,35*65536+10 ;start pos y |
mov edx,50 ;spoke butt |
mov edi,2 ;draw 2 button's |
mov esi,cl_Grey |
call menubutton |
no_drawhi: |
nob2: |
;Draw buttons instruments |
mov eax,8 |
cmp [browser], 1 ;it's browser |
jne nob3 |
mov ebx,10*65536+16+5 ;start pos x |
mov ecx,37*65536+15 ;start pos y |
jmp isb3 |
nob3: |
mov ebx,16*65536+16+5 ;start pos x |
mov ecx,29*65536+15 ;start pos y |
isb3: |
mov edx,8;+1000000000000000000000000000000b ;spoke butt |
mov edi,13 ;draw 13 button's |
mov esi,cl_Grey |
mcall |
dec edi |
nextbut: |
add ebx,(16+6)*65536 |
inc edx |
mcall |
dec edi |
jnz nextbut |
cmp [browser], 1 ;it's browser |
jne nob4 |
;But img browser |
setimg 10,37,butimg |
;left logo |
add eax,[procinfo.box.width] |
sub eax,80 |
mov [temp],eax |
setimg [temp],37,logoimg |
jmp isb4 |
nob4: |
;But img dialog |
setimg 16,29,butimg |
isb4: |
cmp [browser], 1 ;it's browser |
jne nob5 |
mov [urlx],48 |
mov [urly],55 |
mov eax,[procinfo.box.width] |
sub eax,48+10 |
mov [urlxsize],eax |
mov [urlysize],12 |
glabel 20,57,"URL:",cl_Black |
;Out view mode info |
movzx edx, [viewmode] |
shl edx, 4 |
mov eax,4 |
mov ebx,180*65536+25 |
mov ecx,cl_Black |
add edx,modetext |
mov esi,16 |
mcall |
;List size |
outcount [listsize],294,25,cl_Black,4*65536 |
jmp isb5 |
iglobal |
but_dlg: db 'OPEN' |
db 'SAVE' |
endg |
nob5: |
mov [urlx],10 |
mov eax,[procinfo.box.height] |
sub eax,24 |
mov [urly],eax |
mov eax,[procinfo.box.width] |
sub eax,80 |
mov [urlxsize],eax |
mov [urlysize],12 |
cmp byte [dlg_type],'O' ;if byte O - is Open dialog |
jne no_openh |
mcall 71,1,open_dlg ;draw in head OPEN FILE |
jmp no_saveh |
no_openh: |
cmp byte [dlg_type],'S' ;if byte S - is Save dialog |
jne no_saveh |
mcall 71,1,save_dlg ;draw in head SAVE FILE |
no_saveh: |
;Draw OPEN\SAVE button |
mov ebx,0*65536+50 |
mov ecx,0*65536+12 |
mov eax,[procinfo.box.width] |
sub eax,63 |
shl eax,16 |
add ebx,eax |
mov eax,[procinfo.box.height] |
sub eax,25 |
shl eax,16 |
add ecx,eax |
mov eax,8 |
mov edx,5 ;button ID |
mov esi,0x006699aa ;gradient!!! |
mcall |
; label OPEN or SAVE |
mov ebx,[procinfo.box.width] |
sub ebx,48 |
mov eax,[procinfo.box.height] |
sub eax,22 |
shl ebx,16 |
add ebx,eax |
cmp byte [dlg_type],'O' ;if byte O - is Open dialog |
jne no_openb |
mov edx,but_dlg ;draw in head OPEN FILE |
jmp out_labx |
no_openb: |
cmp byte [dlg_type],'S' ;if byte S - is Save dialog |
jne no_saveb |
mov edx,but_dlg+4 ;draw in head SAVE FILE |
out_labx: |
mov ecx,cl_White |
mov esi,4 |
mov eax,4 |
mcall |
no_saveb: |
isb5: |
anti_flick: |
cmp [flick],2 |
je draw_url |
cmp [flick],0 |
jne no_flick_url |
;*************************** |
; DRAW URL LINE |
;*************************** |
draw_url: |
;Draw URL focus button |
mov ebx,[urlx] |
shl ebx,16 |
add ebx,[urlxsize] |
mov ecx,[urly] |
shl ecx,16 |
add ecx,[urlysize] |
dec ebx |
dec ecx |
mov eax,8 |
mov edx,2 ;button ID |
mov esi,0x00aaaaaa ;gradient!!! |
mcall |
;Draw URL String |
mov eax,13 |
mov edx,cl_Black |
mcall |
add ebx,1*65536-2+1 |
add ecx,1*65536-2+1 |
mov edx,cl_White |
mcall |
;Draw URL Cursor |
mov eax,6 |
mul [cursor] |
mov ebx,[urlx] |
add ebx,eax |
shl ebx,16 |
add ebx,2*65536+1 |
mov ecx,[urly] |
shl ecx,16 |
add ecx,[urlysize] |
add ecx,2*65536-4 |
mov eax,13 |
mov edx,cl_Black |
mcall |
; OUT TEXT |
mov eax,[urlxsize] ;calculating text leight |
sub eax,8 |
mov ebx,6 |
div ebx |
mov esi,eax |
mov ebx,[urlx] |
shl ebx,16 |
add ebx,[urly] |
add ebx,3*65536+2 |
mov eax,4 ; function 4 : write text to window |
mov ecx,0x00000000 ;[sc.grab_text] ; color of text RRGGBB |
mov edx,path ; pointer to text beginning |
mcall |
cmp [flick],2 |
jne no_flick_url |
mov [flick],0 |
jmp still |
no_flick_url: |
;*************************** |
; DRAW FILE LIST |
;*************************** |
;Draw Scroll Line |
mov eax,13 |
mov ebx,[listx] |
add ebx,[listxsize] |
sub ebx,[scrollsize] |
shl ebx,16 |
add ebx,dword [scrollsize] |
mov ecx,[listy] |
add ecx,scrollbutsize |
shl ecx,16 |
add ecx,[listysize] |
sub ecx,scrollbutsize*2 |
mov edx,[scrollcolor] ;0x00006600 |
mcall |
;Draw Scroll Box |
mov edx,0 |
mov eax,[listysize] |
sub eax,2 |
mov ebx,dword 10 |
div ebx |
mov ebx,eax |
cmp ebx,[listsize] ;filelistsize in ebx |
jae notusescroll |
;usescroll |
; calculate scroll size |
mov eax, [listysize] |
sub eax, 2*scrollbutsize |
push eax |
mul ebx |
div [listsize] |
cmp eax, 5 |
jae @f |
mov al, 5 |
@@: |
mov [scroll_height], eax |
; calculate scroll pos |
sub [esp], eax |
mov eax, [listsize] |
sub eax, ebx |
mov ecx, eax |
cmp eax, [filecursor] |
jb @f |
mov eax, [filecursor] |
@@: |
mul dword [esp] |
div ecx |
mov [scroll_pos], eax |
pop ecx |
; draw |
lea ecx, [eax+scrollbutsize] |
add ecx, [listy] |
shl ecx, 16 |
mov cx, word [scroll_height] |
mov eax, 13 |
mov ebx, [listx] |
add ebx, [listxsize] |
sub ebx, [scrollsize] |
shl ebx, 16 |
mov bx, word [scrollsize] |
mov edx, [scrollboxcol] |
mcall |
notusescroll: |
;Draw list button for get file name |
mov ebx,[listx] |
shl ebx,16 |
add ebx,[listxsize] |
sub ebx,15 ;right free zone |
sub ebx,[scrollsize] |
mov ecx,[listy] |
shl ecx,16 |
add ecx,[listysize] |
mov eax,8 |
mov edx,4+0x60000000 |
mcall |
add ebx,15 |
mov eax,13 |
sub ebx,[scrollsize] ;leency |
mov edx,[listcolor] ;ffffff |
mcall |
;Draw up/down buttons |
mov ebx,[listx] |
add ebx,[listxsize] |
sub ebx,[scrollsize] |
shl ebx,16 |
add ebx,[scrollsize] |
mov ecx,[listy] |
shl ecx,16 |
add ecx,scrollbutsize-1 |
mov eax,8 |
mov edx,6+1000000000000000000000000000000b ;spoke butt |
mcall |
inc ecx |
mov eax,13 |
mov edx,[scrollbutcol] |
mcall |
; Draw image on up button |
pushad |
shr ebx,16 |
mov edx,ebx |
shl edx,16 |
shr ecx,16 |
add edx,ecx |
mov ecx,8*65536+9 |
mov ebx,upsb+8 |
mov eax,7 |
mcall |
popad |
dec ecx ;correction |
mov edx,7+1000000000000000000000000000000b ;spoke butt |
mov eax,[listysize] |
sub eax,scrollbutsize |
shl eax,16 |
add ecx,eax |
mov eax,8 |
mcall |
inc ecx |
mov eax,13 |
mov edx,[scrollbutcol] ;ffffff |
mcall |
; Draw image on down button |
pushad |
shr ebx,16 |
mov edx,ebx |
shl edx,16 |
shr ecx,16 |
add edx,ecx |
mov ecx,8*65536+9 |
mov ebx,dnsb+8 |
mov eax,7 |
mcall |
popad |
; Draw text in file list |
; mov eax,[listxsize] |
; sub eax,40*6 ;leight of string |
; shr eax,1 |
; add eax,[listx] |
mov eax, [listx] |
add eax, 12+4 ; for icons |
shl eax,16 |
add eax,[listy] |
add eax,2 |
mov [filelistxy],eax ;dword 19*65536+58 |
mov edx,0 |
mov eax,[listysize] |
sub eax,2 |
mov ebx,dword 10 |
div ebx |
mov [filelistsize],eax ;dword 40 |
; OUT FILE DATA |
mov eax,[filecursor] ;calc cursor position |
mov ebx,27 |
mul ebx |
;OUT TEXT |
mov ebp,4096 ; 16 ;out strings process |
sub ebp,[filecursor] |
mov edx,convinfo ;fileinfo+11 |
add edx,eax |
mov ebx,dword [filelistxy] |
loo: |
cmp dword [edx], -1 |
jz noout |
mov ecx,0x00888888 ;for another file's color white |
cmp [edx+15],dword 'FOL ' ;folder yellow |
jne nb |
mov ecx,0x00006666 |
jmp cset1 |
nb: |
mov eax, [edx] |
xor edi, edi |
; find extension and set color |
@@: |
inc eax |
cmp byte [eax-1], 0 |
jz @f |
cmp byte [eax-1], '.' |
jnz @b |
mov edi, eax |
jmp @b |
@@: |
test edi, edi |
jz @f |
mov edi, [edi] |
and edi, not 0x20202020 ; toupper |
@@: |
;Color set |
; text's blue |
mov ecx, 0x00446666 |
cmp edi, 'TXT' |
jz cset |
cmp edi, 'INC' |
jz cset |
cmp edi, 'ASM' |
jz cset |
cmp edi, 'RTF' |
jz cset |
; picture's pure |
mov ecx, 0x00226688 |
cmp edi, 'BMP' |
jz cset |
cmp edi, 'JPG' |
jz cset |
cmp edi, 'JPEG' |
jz cset |
cmp edi, 'GIF' |
jz cset |
cmp edi, 'PNG' |
jz cset |
cmp edi, 'WAV' |
jz cset |
cmp edi, 'MID' |
jz cset |
; execute's green |
mov ecx, 0x00008866 |
test edi, edi |
jz cset |
; for another file's color white |
mov ecx, 0x00888888 |
cset: |
cset1: |
push edx |
mov edx,[edx] |
push ebx edx |
mov eax, [listxsize] |
sub eax, [scrollsize] |
sub eax, 12+4 |
xor edx, edx |
mov ebx, 6 |
div ebx |
pop edx ebx |
sub eax, 25 |
xor esi, esi |
@@: |
cmp byte [edx+esi], 0 |
jz @f |
inc esi |
cmp esi, eax |
jbe @b |
dec esi |
@@: |
push eax |
mov eax,4 |
mcall |
cmp byte [edx+esi], 0 |
jz @f |
pushad |
mov edx, more_char |
mov eax, esi |
imul eax, 6*65536 |
add ebx, eax |
mov esi, 1 |
mov eax, 4 |
mcall |
popad |
@@: |
pop eax |
pop edx |
push ebx edx |
inc eax |
imul eax, 6*65536 |
add ebx, eax |
add edx,4 |
mov esi,23 |
mov eax,4 |
mcall |
pop edx ebx |
pushad |
cmp [edx+15],dword 'Fvol' ;volume label |
jne no_volico |
push hdico+8 |
jmp out_ico |
no_volico: |
cmp [edx+15],dword 'FOL ' |
jne no_folico |
cmp [edx+4],dword 'HARD' |
jne no_hdico |
push hdico+8 |
jmp out_ico |
no_hdico: |
cmp [edx+4],dword 'RAMD' |
jne no_rdico |
push rdico+8 |
jmp out_ico |
no_rdico: |
cmp [edx+4],dword 'FLOP' |
jne no_fdico |
push rdico+8 |
jmp out_ico |
no_fdico: |
cmp [edx+4],dword 'CD-R' |
jne no_cdico |
push cdico+8 |
jmp out_ico |
no_cdico: |
push folico+8 |
jmp out_ico |
no_folico: |
cmp edi,dword 'BMP' |
je is_imgico |
cmp edi,dword 'JPG' |
je is_imgico |
cmp edi,dword 'JPEG' |
je is_imgico |
cmp edi,dword 'GIF' |
je is_imgico |
cmp edi,dword 'PNG' |
je is_imgico |
cmp edi,dword 'ICO' |
je is_imgico |
cmp edi,dword 'WAV' |
je is_imgico |
cmp edi,dword 'MID' |
je is_imgico |
cmp edi,dword 'MP3' |
je is_imgico |
cmp edi,dword 'XM' |
je is_imgico |
jmp no_imgico |
is_imgico: |
push imgico+8 |
jmp out_ico |
no_imgico: |
cmp edi,dword 'ASM' |
je is_asmincico |
cmp edi,dword 'INC' |
je is_asmincico |
cmp edi,dword 'INI' |
je is_asmincico |
cmp edi,dword 'CONF' |
je is_asmincico |
jmp no_asmincico |
is_asmincico: |
push asmincico+8 |
jmp out_ico |
no_asmincico: |
cmp edi,dword 'RTF' |
je @f |
cmp edi,dword 'TXT' |
jne no_txtico |
cmp edi,dword 'LOG' |
jne no_txtico |
@@: |
push txtico+8 |
jmp out_ico |
no_txtico: |
test edi,edi |
jne no_execico |
push execico+8 |
jmp out_ico |
no_execico: |
cmp [edx+15],dword 'DAT ' |
jne no_datico |
push datico+8 |
jmp out_ico |
no_datico: |
cmp [edx+15],dword 'DEL ' |
jne no_out_ico |
push delico+8 |
jmp out_ico |
out_ico: |
mov edx,ebx |
sub edx,14*65536+1 |
mov ecx,12*65536+9 |
; mov ebx,upsb+8 |
pop ebx |
mov eax,7 |
mcall |
no_out_ico: |
popad |
add ebx,10 |
noout: |
add edx,27 |
dec [filelistsize] |
jz extloo |
dec ebp |
jnz loo |
dext: |
mov [downstop],1 |
extloo: |
cmp [browser], 1 ;it's browser |
jne nob8 |
;Draw text for head->file buttons |
cmp [drawhf],1 |
jne no_drawhftext |
drawfbox 8,35,(6*12)+1,11*8,0x00000000 |
drawfbox 9,36,(6*12)-1,(11*8)-2,0x00ffffff |
mov edi,8 |
mov ebx,9*65536+37 |
mov ecx,cl_Black |
mov edx,file_text_label |
call drawmenu |
iglobal |
file_text_label: |
db ' Open ' |
db ' Copy ' |
db ' Paste ' |
db ' Delete ' |
db ' Tinypad ' |
db ' Edit ' |
db ' ' |
db ' Exit ' |
endg |
no_drawhftext: |
;Draw text for head->view buttons |
cmp [drawhv],1 |
jne no_drawhvtext |
drawfbox (8+6*8),35,(6*12)+1,(11*4),0x00000000 |
drawfbox (9+6*8),36,(6*12)-1,(11*4)-2,0x00ffffff |
mov edi,4 |
mov ebx,(9+6*8)*65536+37 |
mov ecx,cl_Black |
mov edx,view_text_label |
call drawmenu |
iglobal |
view_text_label: |
db ' Name sort ' |
db ' Ext. sort ' |
db ' Size sort ' |
db ' Date sort ' |
endg |
no_drawhvtext: |
;Draw text for head->info buttons |
cmp [drawhi],1 |
jne no_drawhitext |
drawfbox (8+12*8),35,(6*12)+1,(11*2),0x00000000 |
drawfbox (9+12*8),36,(6*12)-1,(11*2)-2,0x00ffffff |
mov edi,2 |
mov eax,4 |
mov ebx,(9+12*8)*65536+37 |
mov ecx,cl_Black |
mov edx,info_text_label |
call drawmenu |
iglobal |
info_text_label: |
db ' Help ' |
db ' About ' |
endg |
no_drawhitext: |
nob8: |
cmp [flick],1 |
jne no_flick |
mov [flick],0 |
jmp still |
no_flick: |
ret |
;FILE LIST PARAMETRS |
iglobal |
listx dd 15 |
listy dd 72 |
listxsize dd 350 |
listysize dd 41 |
filelistxy dd 0 |
filelistsize dd 0 |
scrollsize dd 8 |
listcolor dd 0xffffff ;0xeeeeee |
scrollcolor dd 0x778877 |
scrollboxcol dd 0x335533 |
scrollbutcol dd 0x224422 |
scrollbutsize = 9 |
;URL LINE PARAMETRS |
urlx dd 10 |
urly dd 20 |
urlxsize dd 350 |
urlysize dd 12 |
endg |
drawmenu: |
mov eax,4 |
mov esi,12 |
menuloo: |
mcall |
add ebx,11 |
add edx,12 |
dec edi |
jnz menuloo |
ret |
menubutton: |
mov eax,8 |
nextmenubut: |
mcall |
add ecx,11*65536 |
inc edx |
dec edi |
jnz nextmenubut |
ret |
;***************************** |
; READ FILE STRUCTURE PROC |
;***************************** |
read_directory: |
;STEP 1 CLEAR CONVINFO |
mov edi,convinfo |
mov al,255 |
mov ecx,4096*27 |
cld |
push edi |
rep stosb |
pop edi |
;STEP 2 TEST ON HD OR PARTITION |
cmp [path],byte '/' |
je nstep |
; copy info on RD and FD |
mov esi, hdimg |
mov ecx, 2*27 |
rep movsb |
; hard disks |
mov eax, 4 |
.1: |
mov ecx, 27 |
cmp dword [esi], 0 |
jz .2 |
rep movsb |
jmp .3 |
.2: |
add esi, ecx |
.3: |
dec eax |
jnz .1 |
mov [listsize], 0 |
ret |
nstep: |
cmp [path+3],byte '/' |
je nstep2 |
cmp [path+4],byte '/' |
je nstep2 |
mov ecx,1 |
cmp [path+1],word 'RD' |
jz loxpt |
cmp [path+1],word 'CD' |
jz loxpt |
mov ecx,2 |
cmp [path+1],word 'FD' |
jz loxpt |
cmp [path+1],dword 'HD0' |
jne nostep_HD0 |
movzx ecx,byte [table_area+2] |
jmp loxpt |
nostep_HD0: |
cmp [path+1],dword 'HD1' |
jne nostep_HD1 |
movzx ecx,byte [table_area+3] |
jmp loxpt |
nostep_HD1: |
cmp [path+1],dword 'HD2' |
jne nostep_HD2 |
movzx ecx,byte [table_area+4] |
jmp loxpt |
nostep_HD2: |
cmp [path+1],dword 'HD3' |
jne nostep_HD3 |
movzx ecx,byte [table_area+5] |
jmp loxpt |
nostep_HD3: |
mov ecx,2 |
loxpt: |
cmp ecx, 20 |
jbe @f |
mov ecx, 20 |
@@: |
mov eax, a1 |
mov esi, ptimg |
@@: |
stosd |
add eax, 3 |
push ecx esi |
mov ecx, 23 |
rep movsb |
pop esi ecx |
loop @b |
mov [listsize],0 |
ret |
nstep2: |
;STEP 3 was deleted |
;STEP 4 READ DATA FROM HD |
loorhd: |
mov eax,70 |
mov ebx,fileinfoblock |
mcall |
cmp eax,6 |
je end_of_dir |
; It's erorr's test is poor code |
cmp eax,1 |
jne no_inv_part |
glabel 10,10,'Invalid partition or hd base',cl_Red+font_Big |
jmp end_of_dir |
no_inv_part: |
cmp eax,3 |
jne no_unk_fs |
glabel 10,10,'Unknown file system',cl_Red+font_Big |
jmp end_of_dir |
no_unk_fs: |
end_of_dir: |
; -1 -> 0 |
cmp ebx, -1 |
sbb ebx, -1 |
mov [dirlen],ebx |
; command successful |
mov esi, outinfo+32 |
and [listsize], 0 |
test ebx, ebx |
jz nofiles |
newlineb: |
push ebx |
mov edi, fileinfo |
push edi |
mov al, ' ' |
mov ecx, 27 |
rep stosb |
pop edi |
push esi |
add esi, 40 |
mov [edi], esi |
pop esi |
mov eax, 'DAT ' ; data or ... ? |
mov cl, [esi] |
test cl, 0x10 |
jz @f |
mov eax, 'FOL ' |
mov [edi+15], eax |
jmp nosize |
@@: |
test cl, 8 |
jz novol |
mov eax, 'Fvol' |
mov [edi+15], eax |
jmp nosize |
novol: |
mov [edi+15], eax |
; size |
mov eax, [esi+32] |
push esi |
lea esi, [edi+26] |
mov ebx, 10 |
mov ecx, 8 |
newnum: |
xor edx, edx |
div ebx |
add dl, '0' |
mov [esi], dl |
test eax, eax |
jz zernum |
dec esi |
loop newnum |
zernum: |
pop esi |
nosize: |
; date |
mov dword [edi+6], '. .' |
; year |
movzx eax, word [esi+28+2] |
mov ecx, 4 |
newdel1: |
xor edx, edx |
mov ebx, 10 |
div ebx |
add edx, '0' |
mov [edi+ecx+9], dl |
loop newdel1 |
; month |
movzx eax, byte [esi+28+1] |
xor edx, edx |
div ebx |
add al, '0' |
add dl, '0' |
mov [edi+7], al |
mov [edi+8], dl |
; day |
movzx eax, byte [esi+28] |
xor edx, edx |
div ebx |
add al, '0' |
add dl, '0' |
mov [edi+4], al |
mov [edi+5], dl |
;STEP 5 Test on WRITE OR NOTWRITE |
cmp word [esi+40], '.' |
jz nextfl |
cmp word [esi+40], '..' |
jnz @f |
cmp byte [esi+42], 0 |
jz nextfl |
@@: |
; STEP 6 SORT ALGORYTHM |
push esi |
xor esi, esi |
; At first Fold after Dat |
ftestname: |
cmp dword [convinfo+esi], -1 |
jz writefile |
cmp byte [fileinfo+15],'F' |
je F |
cmp byte [fileinfo+15],'D' |
jne add_element |
D: cmp byte [convinfo+esi+15],'D' |
je add_element |
cmp byte [convinfo+esi+15],'F' |
je skipfile |
jmp add_element |
F: cmp byte [convinfo+esi+15],'D' |
je writenow |
; cmp byte [convinfo+esi+15],'F' |
; je add_element |
; jmp add_element |
add_element: |
; compare items |
movzx eax, [viewmode] |
call [compare+eax*4] |
jb writenow |
skipfile: |
add esi,27 |
jmp ftestname |
writenow: |
mov ecx,4096*27-1 |
sub ecx,esi |
ldloop: |
mov al,[convinfo+ecx+esi] |
mov [convinfo+ecx+esi+27],al |
dec ecx |
jns ldloop |
writefile: |
mov ecx,26 |
wfloop: |
mov al,[fileinfo+ecx] |
mov [convinfo+ecx+esi],al |
dec ecx |
jns wfloop |
inc [listsize] |
pop esi |
nextfl: |
add esi, 304 |
pop ebx |
dec ebx |
jnz newlineb |
nofiles: |
ret |
toupper: |
cmp al, 'a' |
jb .ret |
cmp al, 'z' |
ja @f |
.sub20: |
sub al, 0x20 |
.ret: |
ret |
@@: |
cmp al, 0xA0 |
jb .ret |
cmp al, 0xB0 |
jb .sub20 |
cmp al, 0xE0 |
jb .ret |
cmp al, 0xF0 |
jae @f |
sub al, 0xE0-0x90 |
ret |
@@: |
cmp al, 0xF1 |
jnz .ret |
dec eax |
ret |
compare_date: |
pushad |
mov al, [fileinfo+10] |
cmp al, [convinfo+esi+10] |
jnz .ret |
mov al, [fileinfo+11] |
cmp al, [convinfo+esi+11] |
jnz .ret |
mov al, [fileinfo+12] |
cmp al, [convinfo+esi+12] |
jnz .ret |
mov al, [fileinfo+13] |
cmp al, [convinfo+esi+13] |
jnz .ret |
mov al, [fileinfo+7] |
cmp al, [convinfo+esi+7] |
jnz .ret |
mov al, [fileinfo+8] |
cmp al, [convinfo+esi+8] |
jnz .ret |
mov al, [fileinfo+4] |
cmp al, [convinfo+esi+4] |
jnz .ret |
mov al, [fileinfo+5] |
cmp al, [convinfo+esi+5] |
jz compare_name.1 |
.ret: |
popad |
ret |
compare_name: |
pushad |
.1: |
mov edi, dword [convinfo+esi] |
mov esi, dword [fileinfo] |
call strcmpi |
popad |
ret |
compare_ext: |
pushad |
mov esi, dword [convinfo+esi] |
mov edi, dword [fileinfo] |
call find_ext |
xchg esi, edi |
call find_ext |
call strcmpi |
popad |
jz compare_name |
ret |
compare_size: |
pushad |
lea edi, [convinfo+esi+19] |
lea esi, [fileinfo+19] |
mov ecx, 8 |
repz cmpsb |
popad |
jz compare_name |
ret |
strcmpi: |
lodsb |
call toupper |
push eax |
mov al, [edi] |
inc edi |
call toupper |
cmp [esp], al |
pop eax |
jnz @f |
test al, al |
jnz strcmpi |
@@: |
ret |
find_ext: |
lodsb |
test al, al |
jz .noext |
cmp al, '.' |
jnz find_ext |
ret |
.noext: |
dec esi |
ret |
;****************************************************************************** |
title_browser db 'SYSTEM X-TREE FILE BROWSER',0 |
open_dlg db 'OPEN FILE',0 |
save_dlg db 'SAVE FILE',0 |
; DATA AREA |
pmenu_draw dd 0 ;if poup menu is draw,update all window |
flick dd 0 ;anti flick on ? |
drawhf dd 0 ;draw file menu? |
drawhv dd 0 ;draw view menu? |
drawhi dd 0 ;draw info menu? |
cursor dd 0 ;cursor in prompt line |
focus dd 0 ;prompt edit or window? |
downstop dd 0 |
filecursor dd 0 |
mousex dd 0 |
mousey dd 0 |
blocksread dd 0 |
listsize dd 0 ;num of files in directory |
temp dd 0 |
readblock dd 1 |
dlg_type db 0 ;S-save O-open |
browser db 0 ;0-dialog, 1-browser |
viewmode db 0 ;folder sort |
compare dd compare_name |
dd compare_ext |
dd compare_size |
dd compare_date |
aRD db 'RD',0 |
aFD db 'FD',0 |
aHD0 db 'HD0',0 |
aHD1 db 'HD1',0 |
aHD2 db 'HD2',0 |
aHD3 db 'HD3',0 |
aCD0 db 'CD0',0 |
aCD1 db 'CD1',0 |
aCD2 db 'CD2',0 |
aCD3 db 'CD3',0 |
a1 db '1',0,0 |
a2 db '2',0,0 |
a3 db '3',0,0 |
a4 db '4',0,0 |
a5 db '5',0,0 |
a6 db '6',0,0 |
a7 db '7',0,0 |
a8 db '8',0,0 |
a9 db '9',0,0 |
a10 db '10',0 |
a11 db '11',0 |
a12 db '12',0 |
a13 db '13',0 |
a14 db '14',0 |
a15 db '15',0 |
a16 db '16',0 |
a17 db '17',0 |
a18 db '18',0 |
a19 db '19',0 |
a20 db '20',0 |
hdimg: |
dd aRD |
db 'RAMDISK FOL ' |
dd aFD |
db 'FLOPPYDISK FOL ' |
hdimg1 dd 0 |
db 'HARDDISK FOL ' |
hdimg2 dd 0 |
db 'HARDDISK FOL ' |
hdimg3 dd 0 |
db 'HARDDISK FOL ' |
hdimg4 dd 0 |
db 'HARDDISK FOL ' |
ptimg db 'PARTITION FOL ' |
modetext: |
;0123456789012345 |
db 'SORT BY NAME 0' |
db 'SORT BY EXT. 1' |
db 'SORT BY SIZE 2' ;type sort |
db 'SORT BY DATE 3' |
db 'DEL SORT NAME 4' |
db 'DEL SORT EXT. 5' |
db 'DEL SORT SIZE 6' ;type sort |
db 'DEL SORT DATE 7' |
dirlen dd 0x1 |
b_color dd 0x6677cc |
; //// Willow |
;MRUfile: |
; dd 0x0 |
; dd 0x0 |
; dd 0x1 |
; dd path |
; dd tempzone |
; db '/RD/1/MRU.LST',0 |
; //// Willow |
;Name of programs |
editor db '/sys/tinypad',0 |
kiv db '/sys/media/kiv',0 |
ac97 db '/sys/media/ac97snd',0 |
midamp db '/sys/media/midamp',0 |
htmlv db '/sys/network/htmlv',0 |
rtfread db '/sys/rtfread',0 |
view3ds db '/sys/3d/view3ds',0 |
life2 db '/sys/demos/life2',0 |
more_char db 10h |
IncludeIGlobals |
fileinfo_start: |
dd 7 |
dd 0 |
fileinfo_params: |
dd 0 |
dd 0 |
dd 0 |
db 0 |
fileinfo_name: |
dd 0 |
clipfile_info: |
dd ? |
dd 0 |
dd 0 |
dd ? |
dd paramtest |
db '/SYS/CLIPFILE.TXT',0 |
copyr_run: |
dd 7 |
dd 0 |
dd copyr_param |
dd 0 |
dd 0 |
db '/SYS/COPYR',0 |
fileinfoblock: |
dd 0x1 ; read folder |
dd 0x0 ; first block |
dd 0x0 ; flags (ANSI names) |
dd 4095 ; number of blocks to read |
dd outinfo ; ret offset |
path: |
times 1024 db 0 ;path |
table_area: |
rb 10 |
;rb 256 |
but_file: |
file 'systr12.GIF' |
I_END: |
scroll_height dd ? |
scroll_pos dd ? |
butimg: |
rb 400*16*3+8 ;buttons (left pice of picture) |
logoimg: |
rb 70*16*3+8 ;logo (right pice of picture) |
logoinfimg: |
rb 60*60*3+8 ;logoinfo (right pice of picture) |
upsb: |
rb 8*9*3+8 ;up scroll button |
dnsb: |
rb 8*9*3+8 ;down scroll button |
;ICONS RESERVE AREA |
hdico: |
rb 12*9*3+8 |
rdico: |
rb 12*9*3+8 |
folico: |
rb 12*9*3+8 |
datico: |
rb 12*9*3+8 |
delico: |
rb 12*9*3+8 |
imgico: |
rb 12*9*3+8 |
txtico: |
rb 12*9*3+8 |
asmincico: |
rb 12*9*3+8 |
execico: |
rb 12*9*3+8 |
cdico: |
rb 12*9*3+8 |
tempimg: ;reserve ram for images |
rb 400*100*3+8 ;for picture |
rb 8000 |
MYPID: |
rd 8 |
param_area: |
rb 256 |
paramtest: |
rb 1024 |
filedir: |
rb 1024 |
IncludeUGlobals |
procinfo process_information |
sc system_colors |
fileinfo: |
rb 200 ;4096*62+1024 |
copyr_param rb 256 |
outinfo: |
rb 32+4096*304 |
convinfo: |
rb 4096*27 |
; stack |
align 4 |
rb 1024 |
RAM_END: |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
/programs/other/outdated/sysxtree/trunk/ascgl.inc |
---|
0,0 → 1,816 |
lang equ ru |
; |
; Assembler |
; SMALL |
; CODE |
; Graphics |
; Libary |
; |
; Ver 0.18 By Pavlushin Evgeni (RUSSIA) |
; www.waptap@mail.ru |
;InfoList |
;0.01 LoadImage |
;0.02 SetBmp |
;0.03 Bmptoimg, Setimg ~01.03.2004 |
;0.04 Bug deleted, copyimg ~03.05.2004 |
;0.05 fullimg, collimg ~05.05.2004 |
;0.06 getimg ~09.05.2004 |
;0.07 convbmp ~13.05.2004 |
;0.08 fps ~14.05.2004 |
;0.09 drawfbox ~03.06.2004 |
;0.10 all macros optimized by Halyavin A., add at ~07.06.2004 |
;0.11 many macros optimized by Halyavin A., add at ~30.08.2004 |
;0.12 bmptoimg ~07.09.2004 |
;0.13 imgtoimg ~08.09.2004 |
;0.14 imgtoimg modify not brake bmp pict! ~09.09.2004 |
;0.15 giftoimg, giftoani ~10.09.2004 |
;0.16 setframe, rgbtobgr, setbmp deleted ~20.09.2004 |
;0.17 modification giftoimg, giftoani, getframeoff ~01.10.2004 |
;0.18 aframetoimg,aimgtoimg,frametoimg ~03.10.2004 |
aframetoimg_use_count=0 |
macro aframetoimg img, x, y, canvas,acol |
{ |
local loo,loo2,acolor |
aframetoimg_use_count=aframetoimg_use_count+1 |
if aframetoimg_use_count = 1 |
jmp end_aframetoimg_proc |
acolor dd 0 |
aframetoimg_proc: |
;getout coord |
mov [acolor],ebp |
mov edx,ebx ;img ;xsize |
movzx eax,word [edx] |
add eax,esi ;y cor |
; mov eax,esi ;y cor |
mul dword [ecx] ;canvas xsize |
add eax,edi ;x cor |
mov ebp,ebx ;img ;xsize |
movzx edx,word [ebp] |
add eax,edx |
mov ebp,eax |
shl eax,1 |
add ebp,eax |
add ebp,ecx ;canvas+8;start |
add ebp,8 |
;get img size |
add ebx,4 |
mov eax,ebx ;img ;xsize |
movzx esi,word [eax] |
movzx edi,word [eax+2] |
add ebx,4 |
mov edx,ebx ;img+8 |
loo2: |
push esi |
loo: |
;test on alpha color |
mov eax,[edx] |
shl eax,8 |
shr eax,8 |
cmp eax,[acolor] |
jne yx |
add edx,3 |
add ebp,3 |
jmp nx |
yx: |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
nx: |
dec esi |
jnz loo |
pop esi |
sub ebp,3 |
mov eax,[ecx] ;offset = offset+((canxsize-imgxsize)*3) |
sub eax,esi |
add ebp,eax |
shl eax,1 |
add ebp,eax |
add ebp,3 |
dec edi |
jnz loo2 |
ret |
end_aframetoimg_proc: |
end if |
push img |
push canvas |
push x |
push y |
push acol |
pop ebp |
pop esi |
pop edi |
pop ecx |
pop ebx |
call aframetoimg_proc |
} |
frametoimg_use_count=0 |
macro frametoimg img, x, y, canvas |
{ |
local loo,loo2 |
frametoimg_use_count=frametoimg_use_count+1 |
if frametoimg_use_count = 1 |
jmp end_frametoimg_proc |
frametoimg_proc: |
;getout coord |
mov edx,ebx ;img ;xsize |
movzx eax,word [edx] |
add eax,esi ;y cor |
; mov eax,esi ;y cor |
mul dword [ecx] ;canvas xsize |
add eax,edi ;x cor |
mov ebp,ebx ;img ;xsize |
movzx edx,word [ebp] |
add eax,edx |
mov ebp,eax |
shl eax,1 |
add ebp,eax |
add ebp,ecx ;canvas+8;start |
add ebp,8 |
;get img size |
add ebx,4 |
mov eax,ebx ;img ;xsize |
movzx esi,word [eax] |
movzx edi,word [eax+2] |
add ebx,4 |
mov edx,ebx ;img+8 |
loo2: |
push esi |
loo: |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
dec esi |
jnz loo |
pop esi |
sub ebp,3 |
mov eax,[ecx] ;offset = offset+((canxsize-imgxsize)*3) |
sub eax,esi |
add ebp,eax |
shl eax,1 |
add ebp,eax |
add ebp,3 |
dec edi |
jnz loo2 |
ret |
end_frametoimg_proc: |
end if |
push img |
push canvas |
push x |
push y |
pop esi |
pop edi |
pop ecx |
pop ebx |
call frametoimg_proc |
} |
aimgtoimg_use_count=0 |
macro aimgtoimg img, x, y, canvas,acol |
{ |
local loo,loo2,acolor |
aimgtoimg_use_count=aimgtoimg_use_count+1 |
if aimgtoimg_use_count = 1 |
jmp end_aimgtoimg_proc |
acolor dd 0 |
aimgtoimg_proc: |
;getout coord |
mov [acolor],ebp |
mov eax,esi ;y cor |
mul dword [ecx] ;canvas xsize |
add eax,edi ;x cor |
mov ebp,eax |
shl eax,1 |
add ebp,eax |
add ebp,ecx ;canvas+8;start |
add ebp,8 |
;get img size |
mov eax,ebx ;img ;xsize |
mov esi,[eax] |
add ebx,4 |
mov eax,ebx ; img+4 ;ysize |
mov edi,[eax] |
add ebx,4 |
mov edx,ebx ;img+8 |
loo2: |
push esi |
loo: |
;test on alpha color |
mov eax,[edx] |
shl eax,8 |
shr eax,8 |
cmp eax,[acolor] |
jne yx |
add edx,3 |
add ebp,3 |
jmp nx |
yx: |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
nx: |
dec esi |
jnz loo |
pop esi |
sub ebp,3 |
mov eax,[ecx] ;offset = offset+((canxsize-imgxsize)*3) |
sub eax,esi |
add ebp,eax |
shl eax,1 |
add ebp,eax |
add ebp,3 |
dec edi |
jnz loo2 |
ret |
end_aimgtoimg_proc: |
end if |
push img |
push canvas |
push x |
push y |
push acol |
pop ebp |
pop esi |
pop edi |
pop ecx |
pop ebx |
call aimgtoimg_proc |
} |
imgtoimg_use_count=0 |
macro imgtoimg img, x, y, canvas |
{ |
local loo,loo2 |
imgtoimg_use_count=imgtoimg_use_count+1 |
if imgtoimg_use_count = 1 |
jmp end_imgtoimg_proc |
imgtoimg_proc: |
;getout coord |
mov eax,esi ;y cor |
mul dword [ecx] ;canvas xsize |
add eax,edi ;x cor |
mov ebp,eax |
shl eax,1 |
add ebp,eax |
add ebp,ecx ;canvas+8;start |
add ebp,8 |
;get img size |
mov eax,ebx ;img ;xsize |
mov esi,[eax] |
add ebx,4 |
mov eax,ebx ; img+4 ;ysize |
mov edi,[eax] |
add ebx,4 |
mov edx,ebx ;img+8 |
loo2: |
push esi |
loo: |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
mov al,byte [edx] |
mov byte [ebp],al |
inc ebp |
inc edx |
dec esi |
jnz loo |
pop esi |
sub ebp,3 |
mov eax,[ecx] ;offset = offset+((canxsize-imgxsize)*3) |
sub eax,esi |
add ebp,eax |
shl eax,1 |
add ebp,eax |
add ebp,3 |
dec edi |
jnz loo2 |
ret |
end_imgtoimg_proc: |
end if |
push img |
push canvas |
push x |
push y |
pop esi |
pop edi |
pop ecx |
pop ebx |
call imgtoimg_proc |
} |
;DrawBox |
macro drawfbox x,y,xs,ys,color |
{ |
words2reg ebx,x,xs ;x*65536+xs |
words2reg ecx,y,ys ;y*65536+ys |
mov edx,color |
mov eax,13 |
mcall |
} |
; FPS - Set Frame Per Second Display |
fps_show_frequency=40 |
macro fps x,y,color,delcolor |
{ |
local spdat,savetime,new_time,fps,fps_cntr,out_fps,new_time,ttt |
local no_out_fps |
jmp spdat |
savetime dd 0 |
fps_cntr dd 0 |
fps dd 0 |
ttt dd 0 |
spdat: |
get_time: |
mov eax,3 |
mcall |
cmp eax,[savetime] |
jne new_time |
inc [fps_cntr] |
cmp dword [ttt],0 |
je out_fps |
dec dword [ttt] |
jmp no_out_fps |
new_time: |
mov [savetime],eax |
mov ebx,[fps_cntr] |
mov [fps],ebx |
mov [fps_cntr],0 |
out_fps: |
if ~(delcolor eq ) |
mov ebx,x*65536+36 |
mov ecx,y*65536+7 |
mov edx,delcolor |
mov eax,13 |
mcall |
end if |
mov dword [ttt],fps_show_frequency |
mov eax,47 |
mov ebx,6*65536 |
; mov bl,0 |
mov edx,x*65536+y |
mov esi,color |
mov ecx,[fps] |
mcall |
no_out_fps: |
} |
; COLLIMG - Collusion image's |
_1dbounce_count=0; |
macro collimg img1_off,x1,y1,img2_off,x2,y2,otv |
{ |
local bounce,exit,anot,bc,nbc |
mov esi,[img1_off] ;xs1 |
mov edi,[img2_off] ;ys2 |
mov eax,x1 ; |
mov ebx,x2 ; |
call _1dbounce |
mov edx,ecx |
mov esi,[img1_off+4] ;ys1 |
mov edi,[img2_off+4] ;ys2 |
mov eax,y1 ; |
mov ebx,y2 ; |
call _1dbounce |
add edx,ecx |
cmp edx,2 |
je bounce |
mov otv,0 |
jmp exit |
_1dbounce_count=_1dbounce_count+1 |
if _1dbounce_count = 1 |
_1dbounce: |
cmp ebx,eax |
jb anot |
add eax,esi |
cmp eax,ebx |
jbe nbc |
bc: |
mov ecx,1 |
ret |
anot: |
add ebx,edi |
cmp ebx,eax |
ja bc |
nbc: |
xor ecx,ecx |
ret |
end if |
bounce: |
mov otv,1 |
exit: |
} |
macro rgbtobgr image |
{ |
local loo |
mov eax,[image] |
mul dword [image+4] |
mov ecx,eax |
mov esi,image+8 |
; add esi,8 |
loo: |
mov al,[esi] |
mov bl,[esi+2] |
mov [esi],bl |
mov [esi+2],al |
add esi,3 |
dec ecx |
jnz loo |
} |
macro setimg x , y ,arg3 |
{ |
mov eax,7 |
mov ebx,arg3 |
add ebx,8 |
mov cx,[arg3] |
shl ecx,16 |
add cx,[arg3+4] |
; wordstoreg ecx,[arg3],[arg3+4] |
words2reg edx, x , y ;arg1*65536+arg2 |
mcall |
} |
macro setframe x , y ,arg3 |
{ |
mov eax,7 |
mov ebx,arg3 |
add ebx,8 |
words2reg edx, x , y ;arg1*65536+arg2 |
add edx,dword [arg3] |
mov ecx,dword [arg3+4] |
mcall |
} |
macro getimg imgsrc,x,y,xs,ys,imgdest |
{ |
local cyc |
if xs eqtype 0 |
mov dword [imgdest],xs |
else |
mov eax,xs |
mov dword [imgdest],eax |
end if |
if ys eqtype 0 |
mov dword [imgdest+4],ys |
else |
mov eax,ys |
mov dword [imgdest+4],eax |
end if |
mov eax,dword [imgsrc] ;getx size |
; lea ecx,[eax+2*eax] |
mov ecx,eax |
shl ecx,1 |
add ecx,eax |
mov ebx,y |
mul ebx |
add eax,x |
mov edx,ecx |
lea eax,[eax+2*eax] ;eax=offset on imsrc |
; mov ebp,eax |
; shl eax,1 |
; add eax,ebp |
mov ecx,xs |
mov ebx,ys |
mov edi,8+imgdest |
lea esi,[eax+8+imgsrc] |
; mov esi,eax |
; add esi,8 |
; add esi,imgsrc |
cld |
cyc: |
movsw |
movsb |
dec ecx |
jne cyc |
add esi,edx |
mov ecx,xs |
sub esi,ecx |
sub esi,ecx |
sub esi,ecx |
dec ebx |
jne cyc |
} |
macro copyimg img2_off,img1_off |
{ |
mov eax,dword [img1_off] |
mov ebx,dword [img1_off+4] |
mul ebx |
lea ecx,[eax+2*eax] |
lea esi,[img1_off+8] |
lea edi,[img2_off+8] |
cld |
rep movsb |
} |
macro fullimg img_off,xs,ys,color |
{ |
local cop |
mov eax,xs |
mov ebx,ys |
mov dword [img_off],eax |
mov dword [img_off+4],ebx |
mul ebx |
lea ebp,[eax+2*eax] |
mov esi,color |
if color eqtype 0 |
mov ecx,color/65536 |
else |
mov ecx,esi |
shr ecx,16 |
end if |
xor edi,edi |
cop: |
mov word [img_off+8+edi],si |
add edi,2 |
mov byte [img_off+8+edi],cl |
inc edi |
cmp edi,ebp |
jne cop |
} |
; number of frame in ecx |
; callculatin offset of raw data |
macro getframeoff num_of_frame,offset_of_animation,offset_of_frame |
{ |
local loo,setpic |
mov ebp,num_of_frame ;ecx |
mov esi,offset_of_animation;Image |
loo: |
cmp ebp,0 |
je setpic |
movzx eax,word [esi+4] |
movzx ebx,word [esi+6] |
mul ebx ;dword [esi+4] |
mov ebx,3 |
mul ebx |
add eax,8 |
add esi,eax |
dec ebp |
jmp loo |
setpic: |
mov dword offset_of_frame,esi |
} |
; BMPTOIMG -Convert BMP format TO IMG format |
; (SYNTAX) BMPTOIMG BMP_source_offset,IMG_dest_ofset |
; (SAMPLE) View BMPLS.ASM sample. |
; ( NOTE ) This is macros is not brake bmp structure! Tested in 32,8,4 bits |
bmptoimg_data_area_count=0 |
macro bmptoimg bmp_load_area,img_dest_area |
{ |
local fileinfo,string,end_bmp,nodix |
local converttable,noaddelem,nextbit,convert1bpp,convert4bpp,convert2 |
local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize |
;local qwe,bmpfn |
; convert: |
movzx eax,word [bmp_load_area+28] |
mul dword [bmp_load_area+18] |
add eax,31 |
shr eax,5 |
mov dword [bmptoimg_data_area_dwps],eax ;dwps-doublewords per string |
shl eax,2 |
mov dword [bmptoimg_data_area_bps],eax ;bps-bytes per string |
cmp dword [bmp_load_area+34],0 |
jne yespicsize ;if picture size is defined |
mul dword [bmp_load_area+22] |
mov dword [bmp_load_area+34],eax |
yespicsize: |
mov ebp,img_dest_area+8 |
mov eax,bmp_load_area |
mov ebx,eax |
add ebx, [bmp_load_area+2];file size |
inc ebx |
mov dword [bmptoimg_soi],ebx ;soi-start of image area for drawing |
add eax, [bmp_load_area+10] |
mov dword [bmptoimg_data_area_sop],eax ;sop-start of picture in file |
add eax, [bmp_load_area+34] |
mov dword [bmptoimg_data_area_eop],eax ;eop-end of picture in file |
mov eax, [bmp_load_area+18] |
lea eax,[eax+2*eax] ;3x pixels in eax |
mov edi,dword [bmptoimg_soi] ;initializing |
mov esi,dword [bmptoimg_data_area_eop] |
sub esi,dword [bmptoimg_data_area_bps] |
nextstring: |
push edi |
push ebp |
cmp word [bmp_load_area+28],24 |
jne convertno32 |
mov edi,ebp |
mov ecx,[bmptoimg_data_area_dwps] |
cld |
rep movsd |
convert1: |
pop ebp |
pop edi |
sub esi,dword [bmptoimg_data_area_bps] |
sub esi,dword [bmptoimg_data_area_bps] |
cmp esi,dword [bmptoimg_data_area_sop] |
jb end_bmp |
add edi,eax |
add ebp,eax |
jmp nextstring |
convertno32: |
mov ebx,bmp_load_area |
add ebx, [bmp_load_area+14] |
add ebx,14 ;start of color table |
push esi |
add esi,dword [bmptoimg_data_area_bps] |
mov dword [bmptoimg_data_area_eos],esi |
pop esi |
nextelem: |
push eax |
movzx eax,byte [esi] |
cmp word [bmp_load_area+28],4 |
je convert4bpp |
cmp word [bmp_load_area+28],1 |
je convert1bpp |
call converttable |
convert2: |
pop eax |
inc esi |
cmp esi,dword [bmptoimg_data_area_eos] |
jae convert1 |
add edi,3 |
add ebp,3 |
jmp nextelem |
convert4bpp: |
shl ax,4 |
shr al,4 |
push ax |
movzx eax,ah |
call converttable |
add edi,3 |
add ebp,3 |
pop ax |
movzx eax,al |
call converttable |
jmp convert2 |
convert1bpp: |
mov ecx,eax |
mov edx,7 |
nextbit: |
xor eax,eax |
bt ecx,edx |
jnc noaddelem |
inc eax |
noaddelem: |
push edx |
call converttable |
pop edx |
dec edx |
js convert2 |
add edi,3 |
add ebp,3 |
jmp nextbit |
converttable: |
shl eax,2 |
add eax,ebx |
mov edx, dword [eax] |
; mov dword [edi],edx |
mov [ebp],edx |
ret |
bmptoimg_data_area_count=bmptoimg_data_area_count+1 |
if bmptoimg_data_area_count = 1 |
; DATA AREA |
bmptoimg_soi dd 0 |
bmptoimg_data_area_bps dd 0 |
bmptoimg_data_area_dwps dd 0 |
bmptoimg_data_area_sop dd 0 |
bmptoimg_data_area_eop dd 0 |
bmptoimg_data_area_eos dd 0 |
end if |
end_bmp: |
mov eax,dword [bmp_load_area+18] |
mov ebx,dword [bmp_load_area+22] |
mov dword [img_dest_area],eax |
mov dword [img_dest_area+4],ebx |
} |
if used ReadGIF |
; For convert RGB to BGR |
COLOR_ORDER equ MENUETOS |
include 'gif_lite.inc' |
end if |
macro giftoani gifsrc,imgsrc,num_of_frames |
{ |
gif_img_count = num_of_frames |
mov esi, gifsrc |
mov edi, imgsrc |
call ReadGIF |
} |
macro giftoimg gifsrc,imgsrc |
{ |
if defined gif_img_count |
error 'giftoimg cannot be used in GIF multiple images mode. Use giftoani instead.' |
end if |
mov esi, gifsrc |
mov edi, imgsrc |
call ReadGIF |
} |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
/programs/other/outdated/sysxtree/trunk/gif_lite.inc |
---|
0,0 → 1,485 |
; GIF LITE v3.0 by Willow |
; Written in pure assembler by Ivushkin Andrey aka Willow |
; Modified by Diamond |
; |
; This include file will contain functions to handle GIF image format |
; |
; Created: August 15, 2004 |
; Last changed: June 24, 2007 |
; Requires kglobals.inc (iglobal/uglobal macro) |
; (program must 'include "kglobals.inc"' and say 'IncludeUGlobal' |
; somewhere in uninitialized data area). |
; Configuration: [changed from program which includes this file] |
; 1. The constant COLOR_ORDER: must be one of |
; PALETTE - for 8-bit image with palette (sysfunction 65) |
; MENUETOS - for MenuetOS and KolibriOS color order (sysfunction 7) |
; OTHER - for standard color order |
; 2. Define constant GIF_SUPPORT_INTERLACED if you want to support interlaced |
; GIFs. |
; 3. Single image mode vs multiple image mode: |
; if the program defines the variable 'gif_img_count' of type dword |
; somewhere, ReadGIF will enter multiple image mode: gif_img_count |
; will be initialized with image count, output format is GIF_list, |
; the function GetGIFinfo retrieves Nth image info. Otherwise, ReadGIF |
; uses single image mode: exit after end of first image, output is |
; <dd width,height, times width*height[*3] db image> |
if ~ (COLOR_ORDER in <PALETTE,MENUETOS,OTHER>) |
; This message may not appear under MenuetOS, so watch... |
display 'Please define COLOR_ORDER: PALETTE, MENUETOS or OTHER',13,10 |
end if |
if defined gif_img_count |
; virtual structure, used internally |
struct GIF_list |
NextImg rd 1 |
Left rw 1 |
Top rw 1 |
Width rw 1 |
Height rw 1 |
Delay rd 1 |
Displacement rd 1 ; 0 = not specified |
; 1 = do not dispose |
; 2 = restore to background color |
; 3 = restore to previous |
if COLOR_ORDER eq PALETTE |
Image rd 1 |
end if |
ends |
struct GIF_info |
Left rw 1 |
Top rw 1 |
Width rw 1 |
Height rw 1 |
Delay rd 1 |
Displacement rd 1 |
if COLOR_ORDER eq PALETTE |
Palette rd 1 |
end if |
ends |
; **************************************** |
; FUNCTION GetGIFinfo - retrieve Nth image info |
; **************************************** |
; in: |
; esi - pointer to image list header |
; ecx - image_index (0...img_count-1) |
; edi - pointer to GIF_info structure to be filled |
; out: |
; eax - pointer to RAW data, or 0, if error |
GetGIFinfo: |
push esi ecx edi |
xor eax,eax |
jecxz .eloop |
.lp: |
mov esi,[esi] |
test esi,esi |
jz .error |
loop .lp |
.eloop: |
lodsd |
movsd |
movsd |
movsd |
movsd |
if COLOR_ORDER eq PALETTE |
lodsd |
mov [edi],esi |
else |
mov eax,esi |
end if |
.error: |
pop edi ecx esi |
ret |
end if |
_null fix 0x1000 |
; **************************************** |
; FUNCTION ReadGIF - unpacks GIF image |
; **************************************** |
; in: |
; esi - pointer to GIF file in memory |
; edi - pointer to output image list |
; out: |
; eax - 0, all OK; |
; eax - 1, invalid signature; |
; eax >=8, unsupported image attributes |
; |
ReadGIF: |
push esi edi |
mov [.cur_info],edi |
xor eax,eax |
mov [.globalColor],eax |
if defined gif_img_count |
mov [gif_img_count],eax |
mov [.anim_delay],eax |
mov [.anim_disp],eax |
end if |
inc eax |
cmp dword[esi],'GIF8' |
jne .ex ; signature |
mov ecx,[esi+0xa] |
add esi,0xd |
mov edi,esi |
test cl,cl |
jns .nextblock |
mov [.globalColor],esi |
call .Gif_skipmap |
.nextblock: |
cmp byte[edi],0x21 |
jne .noextblock |
inc edi |
if defined gif_img_count |
cmp byte[edi],0xf9 ; Graphic Control Ext |
jne .no_gc |
movzx eax,word [edi+3] |
mov [.anim_delay],eax |
mov al,[edi+2] |
shr al,2 |
and eax,7 |
mov [.anim_disp],eax |
add edi,7 |
jmp .nextblock |
.no_gc: |
end if |
inc edi |
.block_skip: |
movzx eax,byte[edi] |
lea edi,[edi+eax+1] |
test eax,eax |
jnz .block_skip |
jmp .nextblock |
.noextblock: |
mov al,8 |
cmp byte[edi],0x2c ; image beginning |
jne .ex |
if defined gif_img_count |
inc [gif_img_count] |
end if |
inc edi |
mov esi,[.cur_info] |
if defined gif_img_count |
add esi,4 |
end if |
xchg esi,edi |
if defined GIF_SUPPORT_INTERLACED |
movzx ecx,word[esi+4] |
mov [.width],ecx |
movzx eax,word[esi+6] |
imul eax,ecx |
if ~(COLOR_ORDER eq PALETTE) |
lea eax,[eax*3] |
end if |
mov [.img_end],eax |
inc eax |
mov [.row_end],eax |
and [.pass],0 |
test byte[esi+8],40h |
jz @f |
if ~(COLOR_ORDER eq PALETTE) |
lea ecx,[ecx*3] |
end if |
mov [.row_end],ecx |
@@: |
end if |
if defined gif_img_count |
movsd |
movsd |
mov eax,[.anim_delay] |
stosd |
mov eax,[.anim_disp] |
stosd |
else |
movzx eax,word[esi+4] |
stosd |
movzx eax,word[esi+6] |
stosd |
add esi,8 |
end if |
push edi |
mov ecx,[esi] |
inc esi |
test cl,cl |
js .uselocal |
push [.globalColor] |
mov edi,esi |
jmp .setPal |
.uselocal: |
call .Gif_skipmap |
push esi |
.setPal: |
movzx ecx,byte[edi] |
inc ecx |
mov [.codesize],ecx |
dec ecx |
if ~(COLOR_ORDER eq PALETTE) |
pop [.Palette] |
end if |
lea esi,[edi+1] |
mov edi,.gif_workarea |
xor eax,eax |
lodsb ; eax - block_count |
add eax,esi |
mov [.block_ofs],eax |
mov [.bit_count],8 |
mov eax,1 |
shl eax,cl |
mov [.CC],eax |
mov ecx,eax |
inc eax |
mov [.EOI],eax |
mov eax, _null shl 16 |
.filltable: |
stosd |
inc eax |
loop .filltable |
if COLOR_ORDER eq PALETTE |
pop eax |
pop edi |
push edi |
scasd |
push esi |
mov esi,eax |
mov ecx,[.CC] |
@@: |
lodsd |
dec esi |
bswap eax |
shr eax,8 |
stosd |
loop @b |
pop esi |
pop eax |
mov [eax],edi |
else |
pop edi |
end if |
if defined GIF_SUPPORT_INTERLACED |
mov [.img_start],edi |
add [.img_end],edi |
add [.row_end],edi |
end if |
.reinit: |
mov edx,[.EOI] |
inc edx |
push [.codesize] |
pop [.compsize] |
call .Gif_get_sym |
cmp eax,[.CC] |
je .reinit |
call .Gif_output |
.cycle: |
movzx ebx,ax |
call .Gif_get_sym |
cmp eax,edx |
jae .notintable |
cmp eax,[.CC] |
je .reinit |
cmp eax,[.EOI] |
je .end |
call .Gif_output |
.add: |
mov dword [.gif_workarea+edx*4],ebx |
cmp edx,0xFFF |
jae .cycle |
inc edx |
bsr ebx,edx |
cmp ebx,[.compsize] |
jne .noinc |
inc [.compsize] |
.noinc: |
jmp .cycle |
.notintable: |
push eax |
mov eax,ebx |
call .Gif_output |
push ebx |
movzx eax,bx |
call .Gif_output |
pop ebx eax |
jmp .add |
.end: |
if defined GIF_SUPPORT_INTERLACED |
mov edi,[.img_end] |
end if |
if defined gif_img_count |
mov eax,[.cur_info] |
mov [eax],edi |
mov [.cur_info],edi |
add esi,2 |
xchg esi,edi |
.nxt: |
cmp byte[edi],0 |
jnz .continue |
inc edi |
jmp .nxt |
.continue: |
cmp byte[edi],0x3b |
jne .nextblock |
xchg esi,edi |
and dword [eax],0 |
end if |
xor eax,eax |
.ex: |
pop edi esi |
ret |
.Gif_skipmap: |
; in: ecx - image descriptor, esi - pointer to colormap |
; out: edi - pointer to area after colormap |
and ecx,111b |
inc ecx ; color map size |
mov ebx,1 |
shl ebx,cl |
lea ebx,[ebx*2+ebx] |
lea edi,[esi+ebx] |
ret |
.Gif_get_sym: |
mov ecx,[.compsize] |
push ecx |
xor eax,eax |
.shift: |
ror byte[esi],1 |
rcr eax,1 |
dec [.bit_count] |
jnz .loop1 |
inc esi |
cmp esi,[.block_ofs] |
jb .noblock |
push eax |
xor eax,eax |
lodsb |
test eax,eax |
jnz .nextbl |
mov eax,[.EOI] |
sub esi,2 |
add esp,8 |
jmp .exx |
.nextbl: |
add eax,esi |
mov [.block_ofs],eax |
pop eax |
.noblock: |
mov [.bit_count],8 |
.loop1: |
loop .shift |
pop ecx |
rol eax,cl |
.exx: |
xor ecx,ecx |
ret |
.Gif_output: |
push esi eax edx |
mov edx,.gif_workarea |
.next: |
push word[edx+eax*4] |
mov ax,word[edx+eax*4+2] |
inc ecx |
cmp ax,_null |
jnz .next |
shl ebx,16 |
mov bx,[esp] |
.loop2: |
pop ax |
if COLOR_ORDER eq PALETTE |
stosb |
else |
lea esi,[eax+eax*2] |
add esi,[.Palette] |
if COLOR_ORDER eq MENUETOS |
mov esi,[esi] |
bswap esi |
shr esi,8 |
mov [edi],esi |
add edi,3 |
else |
movsb |
movsb |
movsb |
end if |
end if |
if defined GIF_SUPPORT_INTERLACED |
cmp edi,[.row_end] |
jb .norowend |
mov eax,[.width] |
if ~(COLOR_ORDER eq PALETTE) |
lea eax,[eax*3] |
end if |
push eax |
sub edi,eax |
add eax,eax |
cmp [.pass],3 |
jz @f |
add eax,eax |
cmp [.pass],2 |
jz @f |
add eax,eax |
@@: |
add edi,eax |
pop eax |
cmp edi,[.img_end] |
jb .nextrow |
mov edi,[.img_start] |
inc [.pass] |
add edi,eax |
cmp [.pass],3 |
jz @f |
add edi,eax |
cmp [.pass],2 |
jz @f |
add edi,eax |
add edi,eax |
@@: |
.nextrow: |
add eax,edi |
mov [.row_end],eax |
xor eax,eax |
.norowend: |
end if |
loop .loop2 |
pop edx eax esi |
ret |
uglobal |
align 4 |
ReadGIF.globalColor rd 1 |
ReadGIF.cur_info rd 1 ; image table pointer |
ReadGIF.codesize rd 1 |
ReadGIF.compsize rd 1 |
ReadGIF.bit_count rd 1 |
ReadGIF.CC rd 1 |
ReadGIF.EOI rd 1 |
if ~(COLOR_ORDER eq PALETTE) |
ReadGIF.Palette rd 1 |
end if |
ReadGIF.block_ofs rd 1 |
if defined GIF_SUPPORT_INTERLACED |
ReadGIF.row_end rd 1 |
ReadGIF.img_end rd 1 |
ReadGIF.img_start rd 1 |
ReadGIF.pass rd 1 |
ReadGIF.width rd 1 |
end if |
if defined gif_img_count |
ReadGIF.anim_delay rd 1 |
ReadGIF.anim_disp rd 1 |
end if |
ReadGIF.gif_workarea rb 16*1024 |
endg |
/programs/other/outdated/sysxtree/trunk/ascl.inc |
---|
0,0 → 1,895 |
lang equ ru ; ru en fr ge fi |
; |
; Assembler |
; SMALL |
; CODE |
; Libary |
; |
; Ver 0.14 By Pavlushin Evgeni (RUSSIA) |
; www.waptap@mail.ru |
;Please compile aplications on FASM ver1.54 or higer!!! |
;InfoList |
;0.01 scank,putpix,puttxt |
;0.02 label,random,colors |
;0.03 window,startwd,endwd,attributes |
;0.04 close,delay,scevent ~30.04.2004 |
;0.05 small random, ~04.05.2004 |
;0.06 wtevent ~09.05.2004 |
;0.07 timeevent ~23.05.2004 |
;0.08 txtput ~14.06.2004 |
;0.09 opendialog,savedialog ~20.06.2004 |
;0.10 wordstoreg by halyavin, add at ~30.08.2004 |
; random bug deleted eax is use. |
;0.11 loadfile from me +puttxt bug del ~07.09.2004 |
;0.12 open/save dialog ~13.09.2004 |
;0.13 dialogs bugs deleted |
;0.14 drawlbut ~03.10.2004 |
;0.15 extendet label! |
; LOADFILE |
; (SYNTAX) LOADFILE 'full_path_to_file',file_load_area,file_temp_area |
; (SAMPLE) LOADFILE '/rd/1/clock.bmp',load_area,temp_area |
macro loadfile file_name,file_load_area,file_temp_area |
{ |
local open,fileinfo,string |
jmp open |
fileinfo: |
dd 0 |
dd 0 |
dd 1 |
dd file_load_area |
dd file_temp_area |
string: |
db file_name,0 |
open: |
mov dword [fileinfo+8],1 ; how many blocks to read (1) |
mov eax,58 |
mov ebx,fileinfo |
mcall |
mov eax,[file_load_area+2] |
shr eax,9 ; ¯®¤¥«¨¬ 512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢ |
inc eax |
mov dword [fileinfo+8],eax |
mov eax,58 |
mov ebx,fileinfo |
mcall |
} |
;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 doubleword eq |
; not changes |
else |
mov reg,dword doubleword |
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 |
macro drawlbut x,y,xs,ys,text,id,bcolor,tcolor |
{ |
local asd,lab |
jmp asd |
lab db text ;arg label |
asd: |
words2reg ebx,x,xs |
words2reg ecx,y,ys |
mov edx,id |
mov esi,bcolor |
mov eax,8 |
mcall |
mov eax,asd-lab ;calc size |
mov ebx,6 |
mul ebx |
mov esi,eax |
mov eax,xs |
sub eax,esi |
shr eax,1 |
add eax,x |
mov edx,ys |
sub edx,7 |
shr edx,1 |
add edx,y |
mov ebx,eax |
shl ebx,16 |
add ebx,edx |
mov ecx,tcolor ;arg4 color |
mov edx,lab |
mov esi,asd-lab ;calc size |
mov eax,4 |
mcall |
} |
macro opendialog redproc,openoff,erroff,path |
{ |
local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc |
local run_fileinfo, param |
local getmesloop, loox, mred, mkey, mbutton, mgetmes |
local dlg_is_work, ready, procinfo |
; |
; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec, |
; 1 byte space, 1 byte type of dialog (O - Open ,S - Save) |
; |
cld |
;; mov esi,path |
mov edi,path |
xor eax,eax |
mov ecx,(1024+16)/4 |
rep stosd |
;mov [get_loops],0 |
mov [dlg_pid_get],0 |
; Get my PID in dec format 4 bytes |
mov eax,9 |
mov ebx,procinfo |
mov ecx,-1 |
mcall |
; convert eax bin to param dec |
mov eax,dword [procinfo+30] ;offset of myPID |
mov edi,param+4-1 ;offset to 4 bytes |
mov ecx,4 |
mov ebx,10 |
cld |
new_d: |
xor edx,edx |
div ebx |
add dl,'0' |
mov [edi],dl |
dec edi |
loop new_d |
; wirite 1 byte space to param |
mov [param+4],byte 32 ;Space for next parametr |
; and 1 byte type of dialog to param |
mov [param+5],byte 'O' ;Get Open dialog (Use 'S' for Save dialog) |
; |
; STEP2 prepare IPC area for get messages |
; |
; prepare IPC area |
mov [path],dword 0 |
mov [path+4],dword 8 |
; define IPC memory |
mov eax,60 |
mov ebx,1 ; define IPC |
mov ecx,path ; offset of area |
mov edx,1024+16 ; size |
mcall |
; change wanted events list 7-bit IPC event |
mov eax,40 |
mov ebx,01000111b |
mcall |
; |
; STEP 3 run SYSTEM XTREE with parameters |
; |
mov eax,70 |
mov ebx,run_fileinfo |
mcall |
call redproc |
mov [get_loops],0 |
getmesloop: |
mov eax,23 |
mov ebx,50 ;0.5 sec |
mcall |
dec eax |
jz mred |
dec eax |
jz mkey |
dec eax |
jz mbutton |
cmp al, 7-3 |
jz mgetmes |
; Get number of procces |
mov ebx,procinfo |
mov ecx,-1 |
mov eax,9 |
mcall |
mov ebp,eax |
loox: |
mov eax,9 |
mov ebx,procinfo |
mov ecx,ebp |
mcall |
mov eax,[DLGPID] |
cmp [procinfo+30],eax ;IF Dialog find |
je dlg_is_work ;jmp to dlg_is_work |
dec ebp |
jnz loox |
jmp erroff |
dlg_is_work: |
cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated |
je erroff ;TESTODP2 terminated too |
cmp [dlg_pid_get],dword 1 |
je getmesloop |
inc [get_loops] |
cmp [get_loops],4 ;2 sec if DLG_PID not get, TESTOP2 terminated |
jae erroff |
jmp getmesloop |
mred: |
call redproc |
jmp getmesloop |
mkey: |
mov eax,2 |
mcall ; read (eax=2) |
jmp getmesloop |
mbutton: |
mov eax,17 ; get id |
mcall |
cmp ah,1 ; button id=1 ? |
jne getmesloop |
mov eax,-1 ; close this program |
mcall |
mgetmes: |
; If dlg_pid_get then second message get jmp to still |
cmp [dlg_pid_get],dword 1 |
je ready |
; First message is number of PID SYSXTREE dialog |
; convert PID dec to PID bin |
movzx eax,byte [path+16] |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [path+16+1] |
add eax,ebx |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [path+16+2] |
add eax,ebx |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [path+16+3] |
add eax,ebx |
sub eax,48 |
mov [DLGPID],eax |
; Claear and prepare IPC area for next message |
mov [path],dword 0 |
mov [path+4],dword 8 |
mov [path+8],dword 0 |
mov [path+12],dword 0 |
mov [path+16],dword 0 |
; Set dlg_pid_get for get next message |
mov [dlg_pid_get],dword 1 |
call redproc ;show DLG_PID |
jmp getmesloop |
ready: |
; |
; The second message get |
; Second message is 1024 bytes path to SAVE/OPEN file |
; shl path string on 16 bytes |
; |
cld |
mov esi,path+16 |
mov edi,path |
mov ecx,1024/4 |
rep movsd |
mov [edi],byte 0 |
jmp openoff |
; DATA AREA |
get_loops dd 0 |
dlg_pid_get dd 0 |
DLGPID dd 0 |
param: |
dd 0 ; My dec PID |
dd 0,0 ; Type of dialog |
run_fileinfo: |
dd 7 |
dd 0 |
dd param |
dd 0 |
dd 0 |
;run_filepath |
db '/sys/SYSXTREE',0 |
procinfo: |
times 1024 db 0 |
} |
macro savedialog redproc,openoff,erroff,path |
{ |
local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc |
local run_fileinfo, run_filepath, param |
local getmesloop, loox, mred, mkey, mbutton, mgetmes |
local dlg_is_work, ready, procinfo |
; |
; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec, |
; 1 byte space, 1 byte type of dialog (O - Open ,S - Save) |
; |
cld |
;; mov esi,path |
mov edi,path |
xor eax,eax |
mov ecx,(1024+16)/4 |
rep stosd |
;mov [get_loops],0 |
mov [dlg_pid_get],0 |
; Get my PID in dec format 4 bytes |
mov eax,9 |
mov ebx,procinfo |
mov ecx,-1 |
mcall |
; convert eax bin to param dec |
mov eax,dword [procinfo+30] ;offset of myPID |
mov edi,param+4-1 ;offset to 4 bytes |
mov ecx,4 |
mov ebx,10 |
cld |
new_d: |
xor edx,edx |
div ebx |
add dl,'0' |
mov [edi],dl |
dec edi |
loop new_d |
; wirite 1 byte space to param |
mov [param+4],byte 32 ;Space for next parametr |
; and 1 byte type of dialog to param |
mov [param+5],byte 'S' ;Get Open dialog (Use 'S' for Save dialog) |
; |
; STEP2 prepare IPC area for get messages |
; |
; prepare IPC area |
mov [path],dword 0 |
mov [path+4],dword 8 |
; define IPC memory |
mov eax,60 |
mov ebx,1 ; define IPC |
mov ecx,path ; offset of area |
mov edx,1024+16 ; size |
mcall |
; change wanted events list 7-bit IPC event |
mov eax,40 |
mov ebx,01000111b |
mcall |
; |
; STEP 3 run SYSTEM XTREE with parameters |
; |
mov eax,70 |
mov ebx,run_fileinfo |
mcall |
call redproc |
mov [get_loops],0 |
getmesloop: |
mov eax,23 |
mov ebx,50 ;0.5 sec |
mcall |
dec eax |
jz mred |
dec eax |
jz mkey |
dec eax |
jz mbutton |
cmp al, 7-3 |
jz mgetmes |
; Get number of procces |
mov ebx,procinfo |
mov ecx,-1 |
mov eax,9 |
mcall |
mov ebp,eax |
loox: |
mov eax,9 |
mov ebx,procinfo |
mov ecx,ebp |
mcall |
mov eax,[DLGPID] |
cmp [procinfo+30],eax ;IF Dialog find |
je dlg_is_work ;jmp to dlg_is_work |
dec ebp |
jnz loox |
jmp erroff |
dlg_is_work: |
cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated |
je erroff ;TESTODP2 terminated too |
cmp [dlg_pid_get],dword 1 |
je getmesloop |
inc [get_loops] |
cmp [get_loops],4 ;2 sec if DLG_PID not get, TESTOP2 terminated |
jae erroff |
jmp getmesloop |
mred: |
call redproc |
jmp getmesloop |
mkey: |
mov eax,2 |
mcall ; read (eax=2) |
jmp getmesloop |
mbutton: |
mov eax,17 ; get id |
mcall |
cmp ah,1 ; button id=1 ? |
jne getmesloop |
mov eax,-1 ; close this program |
mcall |
mgetmes: |
; If dlg_pid_get then second message get jmp to still |
cmp [dlg_pid_get],dword 1 |
je ready |
; First message is number of PID SYSXTREE dialog |
; convert PID dec to PID bin |
movzx eax,byte [path+16] |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [path+16+1] |
add eax,ebx |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [path+16+2] |
add eax,ebx |
sub eax,48 |
imul eax,10 |
movzx ebx,byte [path+16+3] |
add eax,ebx |
sub eax,48 |
mov [DLGPID],eax |
; Claear and prepare IPC area for next message |
mov [path],dword 0 |
mov [path+4],dword 8 |
mov [path+8],dword 0 |
mov [path+12],dword 0 |
mov [path+16],dword 0 |
; Set dlg_pid_get for get next message |
mov [dlg_pid_get],dword 1 |
call redproc ;show DLG_PID |
jmp getmesloop |
ready: |
; |
; The second message get |
; Second message is 1024 bytes path to SAVE/OPEN file |
; shl path string on 16 bytes |
; |
cld |
mov esi,path+16 |
mov edi,path |
mov ecx,1024/4 |
rep movsd |
mov [edi],byte 0 |
jmp openoff |
; DATA AREA |
get_loops dd 0 |
dlg_pid_get dd 0 |
DLGPID dd 0 |
param: |
dd 0 ; My dec PID |
dd 0,0 ; Type of dialog |
run_fileinfo: |
dd 7 |
dd 0 |
dd param |
dd 0 |
dd 0 |
;run_filepath: |
db '/sys/SYSXTREE',0 |
procinfo: |
times 1024 db 0 |
} |
; RANDOM - generate random count (small) |
; (SYNTAX) RANDOM MaxCount,OutArgument |
; (SAMPLE) RANDOM 10000,eax |
; ( NOTE ) Maxint<65536 ; use random 65536,eax for more combinations |
randomuse = 0 |
macro random arg1,arg2 |
{ |
local rxproc |
randomuse = randomuse + 1 |
jmp rxproc |
if defined randomuse & randomuse = 1 |
randomproc: |
jmp rnj |
rsx1 dw 0x4321 |
rsx2 dw 0x1234 |
rnj: |
; mov eax,arg1 |
push bx |
push cx |
push dx |
push si |
push di |
mov cx,ax |
mov ax,word ptr rsx1 |
mov bx,word ptr rsx2 |
mov si,ax |
mov di,bx |
mov dl,ah |
mov ah,al |
mov al,bh |
mov bh,bl |
xor bl,bl |
rcr dl,1 |
rcr ax,1 |
rcr bx,1 |
add bx,di |
adc ax,si |
add bx,0x62e9 |
adc ax,0x3619 |
mov word ptr rsx1,bx |
mov word ptr rsx2,ax |
xor dx,dx |
cmp ax,0 |
je nodiv |
cmp cx,0 |
je nodiv |
div cx |
nodiv: |
mov ax,dx |
pop di |
pop si |
pop dx |
pop cx |
pop bx |
and eax,0000ffffh |
; mov arg2,0 |
; mov arg2,eax |
ret |
end if |
rxproc: |
mov eax,arg1 |
call randomproc |
mov arg2,eax |
} |
macro scank |
{ |
mov eax,10 |
mcall |
} |
macro putpix x,y,color |
{ |
mov ebx,x |
mov ecx,y |
mov edx,color |
mov eax,1 |
mcall |
} |
macro puttxt x,y,offs,size,color |
{ |
; mov ebx,x |
; shl ebx,16 |
; add ebx,y |
words2reg ebx,x,y |
dword2reg ecx,color |
dword2reg edx,offs |
dword2reg esi,size |
; mov ecx,color |
; mov edx,offs |
; mov esi,size |
mov eax,4 |
mcall |
} |
macro outcount data, x, y, color, numtype |
{ |
mov ecx,data |
mov ebx,numtype |
mov bl,0 |
; mov edx,x*65536+y |
words2reg edx,x,y |
mov esi,color |
mov eax,47 |
mcall |
} |
; SCEVENT - Scan event |
macro scevent red,key,but |
{ |
mov eax,11 |
mcall |
dec eax |
jz red |
dec eax |
jz key |
dec eax |
jz but |
} |
; WTEVENT - Wait event |
macro wtevent red,key,but |
{ |
mov eax,10 |
mcall |
dec eax |
jz red |
dec eax |
jz key |
dec eax |
jz but |
} |
; TIMEEVENT - Wite for event with timeout |
macro timeevent xfps,noevent,red,key,but |
{ |
mov eax,23 |
mov ebx,xfps |
mcall |
cmp eax,0 |
je noevent |
dec eax |
jz red |
dec eax |
jz key |
dec eax |
jz but |
} |
; CLOSE - Close program |
macro close |
{ |
mov eax,-1 |
mcall |
} |
; DELAY - Create delay 1/100 sec |
; (SYNTAX) Delay time |
; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
macro delay arg1 |
{ |
mov eax,5 |
mov ebx,arg1 |
mcall |
} |
; WINDOW - Draw window |
; (SYNTAX) WINDOW Xstart,Ystart,'Text',Color |
; (SAMPLE) WINDOW 10,10,640+8,480+24,window_Skinned |
macro window arg1,arg2,arg3,arg4,arg5 |
{ |
; mov ebx,arg1*65536+arg3 |
; mov ecx,arg2*65536+arg4 |
words2reg ebx,arg1,arg3 |
words2reg ecx,arg2,arg4 |
mov edx,arg5 |
mov eax,0 |
mcall |
} |
macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
{ |
mov ebx,arg1*65536+arg3 |
mov ecx,arg2*65536+arg4 |
mov edx,arg5 |
mov esi,arg6 |
mov edi,arg7 |
mov eax,0 |
mcall |
} |
; STARTWD - Start of window draw |
macro startwd |
{ |
mov eax,12 |
mov ebx,1 |
mcall |
} |
; ENDWD - End window draw |
macro endwd |
{ |
mov eax,12 |
mov ebx,2 |
mcall |
} |
; LABEL - Put text to frame |
; (SYNTAX) LABEL Xstart,Ystart,'Text',Color |
; (SAMPLE) LABEL 10,12,'Hello World!',cl_Green+font_Big |
macro glabel arg1,arg2,arg3,arg4 |
{ |
local asd,lab |
jmp asd |
lab db arg3 ;arg label |
asd: |
; mov ebx,arg1 ;arg1=y arg2=x |
; shl ebx,16 |
; add ebx,arg2 |
words2reg ebx,arg1,arg2 |
dword2reg ecx,arg4 |
mov edx,lab |
mov esi,asd-lab ;calc size |
mov eax,4 |
mcall |
} |
;Key's |
key_Up equ 178 |
key_Down equ 177 |
key_Right equ 179 |
key_Left equ 176 |
key_Esc equ 27 |
key_Space equ 32 |
key_Enter equ 13 |
key_Bspace equ 8 |
key_F1 equ 50 |
key_F2 equ 51 |
key_F3 equ 52 |
key_F4 equ 53 |
key_F5 equ 54 |
key_F6 equ 55 |
key_F7 equ 56 |
key_F8 equ 57 |
key_F9 equ 48 |
key_F10 equ 49 |
key_F11 equ 68 |
key_F12 equ 255 |
key_Home equ 180 |
key_End equ 181 |
key_PgUp equ 184 |
key_PgDown equ 183 |
;Attributes |
;Window Attributes |
window_Skinned equ 0x03000000 |
window_Type2 equ 0x02000000 |
window_Type1 equ 0x00000000 |
window_Reserve equ 0x01000000 |
;Font Attributes |
font_Big equ 0x10000000 |
;Colors |
cl_White equ 0x00ffffff |
cl_Black equ 0x00000000 |
cl_Grey equ 0x00888888 |
cl_Red equ 0x00ff0000 |
cl_Lime equ 0x0000ff00 |
cl_Green equ 0x0000af00 |
cl_Blue equ 0x000000ff |
cl_Purple equ 0x008080ff |
cl_Violet equ 0x008040ff |
cl_Cyan equ 0x0040e0ff |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
/programs/other/outdated/sysxtree/trunk/build_en.bat |
---|
0,0 → 1,5 |
@erase lang.inc |
@echo lang fix en >lang.inc |
@fasm sysxtree.asm sysxtree |
@erase lang.inc |
@pause |
/programs/other/outdated/sysxtree/trunk/build_ru.bat |
---|
0,0 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm sysxtree.asm sysxtree |
@erase lang.inc |
@pause |
/programs/other/outdated/sysxtree/trunk/systr12.GIF |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/other/outdated/sysxtree/trunk/ascgml.inc |
---|
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: |
} |
/programs/other/outdated/sysxtree/trunk/ascml.inc |
---|
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: |
} |
/programs/other/outdated/sysxtree/trunk/xtree.bmp |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/other/outdated/sysxtree/trunk/xtree.ico |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/other/outdated/sysxtree/trunk/xtreeinf.txt |
---|
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 |
Íîâûé ôàéëîâûé áðàóçåð ïîäåððæèâàþùèé ñîðòèðîâêó ôîèëîâ ïî èìåíè, |
ðàñøèðåíèþ, ðàçìåðó è äàòå. |
Ðàçðàáîòàë Ïàâëþøèí Åâãåíèé äëÿ Menuet OS e-mail: waptap@mail.ru |
ñàéò (ìåäëåííî îáíîâëÿåòñÿ) : www.deck4.narod.ru |
~~~Èíñòðóêöèÿ~~~ |
Ñêîïèðóéòå ïðîãó COPYR íà ramdisk !!! äëÿ âîçìîæíîñòè êîïèðîâàòü è âñòàâëÿòü ôàèëû |
~~~Êëàâèøè~~~ |
PageUp\PageDown , Up Arrow/Down Arrow - Íàâèãàöèÿ |
Blackspace - Ïåðåéòè ê ïðåäèäóùåé ïàïêå |
Enter - Çàéòè â ïàïêó èëè çàïóñòèòü/ïðîñìîòðåòü/ðåäàêòèðîâàòü ôàèë |
F2 - Ñìåíèòü ðåæèì ñîðòèðîâêè (Ïî èìåíè,ðàñøèðåíèþ,ðàçìåðó,äàòå,ïîêàçûâàòü óäàë. ôàèëû) |
F3 - Ïðîñìîòðåòü ôàèë â òåêñòîâîì áëîêíîòå |
F5 - êîïèðîâàòü ôàèë â clipboard |
F6 - âñòàâèòü ôàèë èç clipboard'à |
F12 - Îáíîâèòü ñîäåðæèìîå îêíà |
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 |
/programs/other/outdated/sysxtree/trunk/xtreinfo.txt |
---|
0,0 → 1,80 |
Ñäåëàíà íîâàÿ êîíöåïöèÿ äèàëîãîâ, òåïåðü äèàëîãè íå èñïîëüçóþò |
ôàéëîâóþ ñèñòåìó äëÿ îáìåíà ñ êëèåíòîì, à èñïîëüçóþò IPC - |
Inter process comunication (Ïîääåðæêà íà÷èíàÿ ñ 52 Âåðñèè). |
52 Âåðñèÿ ïîääåðæêà IPC äèàëîãîâ |
53 Âåðñèÿ äîáàâëåíà çàùèòû äèîëîãîâ îò âíåøíèõ ïðîöåññîâ. |
Òåñòèðóéòå ñ TESTOPDG |
54 Âåðñèÿ IPC çàùèòà óëó÷øåíà |
Òåñòèðóéòå ñ TESTOPD2 |
×òî-áû ïðîòåñòèòü äèàëîãè ñêîïèðóéòå SYSTRE54 íà ðàìäèñê ïîä |
èìåíåì SYSXTREE è çàïóñòèòå TESTOPD2 |
 îêíå TESTOPD2 îòîáðàæàåòñÿ ñëåäóþùàÿ èíôîðìàöèÿ: |
 çàãîëîâêå ñëåâà ??? |
Íèæå ïàðàìåòðû ïåðåäàííûå SYSTEM XTREE , à èìåííî PID TESTOPD2, |
ïðîáåë è òèï äèàëîãà îäèí áàéò (O-Open,S-Save) |
Åùå íèæå PID SYSTEM XTREE è òåêóùåå êîë-âî çàïóùåííûõ ïðîöåññîâ |
Ïîñëå òîãî êàê ôàèë áóäåò îòêðûò â äèàëîãå, îí îòîáðàçèòñÿ â |
îêíå TESTOPD2 íèæå çàãîëîâêà, à äèàëîã çàêðîåòñÿ. |
Çàùèòà TESTOPD2: |
1) Åñëè ïðè çàïóñêå SYSTEM XTREE îò XTREE íåáûë ïîëó÷åí åãî PID |
â òå÷åíèè 2 ñåê, çíà÷èò íà ðàìäèñêå íå 54 âåðñèÿ XTREE èëè íå XTREE |
âîâñå, TESTOPD2 çàâåðøàåòñÿ. |
2) Åñëè çàïóùåíûé SYSTEM XTREE çàêðûëñÿ íå îòîñëàâ ïóòüôàèëà(ñàì èëè |
îò CPU ïðîãè),òî TESTOPD2 çàâåðøàåòñÿ ò.ê. ïàðàìåòðû îò XTREE íå |
áûëè ïîëó÷åíû à ò.ê. XTREE çàêðûò òî óæå è íåáóäóò ïîëó÷åíû. |
68 Âåðñèÿ |
Çà äâà äíÿ ÿ äîáèëñÿ ïðèëè÷íûõ óñïåõîâ ïî ìîäåðíèçàöèè X-TREE |
È òàê øî íîâîãî... |
60Ver Òåïåðü FileList è â äèàëîãå è â áðàóçåðå âûâîäèòñÿ îäíîé |
ïðîöåäóðîé íóæíî òîëüêî óêàçàòü êîîðäèíàòû è ðàçìåð ëèñòà îòñëåæèâàíèå |
è ïðîðèñîâêà ñêðîëëáàðà âûïîëíÿåòñÿ ïðîöåäóðîé. |
61Ver Íàñòðîèë êîîðäèíàòû ÔàèëËèñòà |
62Ver Äàáàâèë ïàíåëüêó ñëåâà â îêíå (êàê â Âèíäàõ) äëÿ êðàñîòû |
63Ver Èçìåíèë ñêèí è äîáàâèë êàðòèíêè íà êíîïî÷êè ñêðîëëáàðà |
64Ver Óäàëèë ñòàðûé äîáðûé áàã - îøèáêà çàïóñêà ïðîã ñ HD êîòîðàÿ |
âûíîñèò Ìåîñ íàôèã íå èñêëþ÷àþ, ÷òî ýòîò áàã óäàëåí íå äî êîíöà |
65Ver Èçìåíèë îáðàáîòêó è ïðîðèñîâêó ñêðîëëà |
66Ver Äîâåë äî êîíöà ïðîðèñîâêó ñêðîëëà, äîáàâèë ïðîòèâîìèãàþùèé |
êîä äëÿ URL ñòðîêè |
67Ver Òåïåðü URL ñòðîêà è â äèàëîãå è â áðàóçåðå âûâîäèòñÿ îäíîé |
ïðîöåäóðîé íóæíî òîëüêî óêàçàòü êîîðäèíàòû è ðàçìåð ñòðîêè. |
68Ver Äîáàâèë ìèíè èêîíêè ñëåâà îò ôàèë íåéìà (î÷åíü ïðèêîëüíî ñìîòðèòñÿ). |
73 Âåðñèÿ |
69Ver Getimg âûïîëíèë â âèäå ïðîöåññà, à íå ìàêðîñà êîä óìåíüøèëñÿ |
íà 900 áàéò |
70Ver data_area òåïåðü íå èñïîäëüçóåòñÿ, à çíà÷èò ïàìÿòè òðåáóåòñÿ |
òåïåðü íà 140000 áàéò ìåíüøå! |
72Ver Áîëåå áûñòðàÿ ñîðòèðîâêà , fileinfo òðåáóò òîëüêî 200 áàéò, |
à çíà÷èò ïàìÿòè òåïðü òðåáóåòñÿ íà 200000 áàéò ìåíüøå! |
73Ver Ìèãàíèå Url ñòðîêè áàã èñïðàâëåí. |
Èòîãî êîä óìåíüøåí ãäå-òî íà 900 áàéò. Åñëè ðàíüøå òðåáîâàëîñü ïàìÿòè |
1 ÌÁ, òî òåïåðü âñåãî 600Êá, à ýòî ïî÷òè â äâà ðàçà ìåíüøå. |
80Ver Äèàëîãè îïÿòü ðàáîòàþò, óäàëåí áàã ðåäàêòèðîâàíåèÿ ñòðîêè URL |
81Ver Save äèàëîã ðàáîòàåò áîëåå êîððåêòíî |