upgrade a programme

git-svn-id: svn://kolibrios.org@308 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2007-02-01 11:31:34 +00:00
parent a17b90b7b3
commit 7038d7bc41
3 changed files with 152 additions and 156 deletions

View File

@ -1,29 +1,36 @@
;--- ¤à㣨¥ ¬ ªà®áë --- ;--- ¤à㣨¥ ¬ ªà®áë ---
include 'editbox.inc' include 'editbox.inc'
include 'txtbut.inc' include 'txtbut.inc'
include 'lang.inc' ;include 'gp.inc'
;include 'label.inc'
;include 'checkbox.inc'
;include 'file_sys.inc'
;include 'textwork.inc'
;include 'ini.inc'
lang fix ru;en
;--- § £®«®¢®ª --- ;--- § £®«®¢®ª ---
macro meos_header par_buf,cur_dir_buf macro meos_header par_buf,cur_dir_buf
{ {
use32 use32
org 0x0 org 0x0
db 'MENUET01' db 'MENUET01'
dd 0x01 dd 0x01
dd __app_start dd __app_start
dd __app_end dd __app_end
dd __app_end dd __app_end
dd __app_end dd __app_end
if <par_buf> eq <> if <par_buf> eq <>
dd 0x0 dd 0x0
else else
dd par_buf dd par_buf
end if end if
if <cur_dir_buf> eq <> if <cur_dir_buf> eq <>
dd 0x0 dd 0x0
else else
dd cur_dir_buf dd cur_dir_buf
end if end if
} }
@ -37,9 +44,9 @@ __app_start:
macro app_end stack_size macro app_end stack_size
{ {
if <stack_size> eq <> if <stack_size> eq <>
rb 1024 rb 1024
else else
rb stack_size rb stack_size
end if end if
__app_end: __app_end:
} }
@ -47,196 +54,196 @@ __app_end:
;--- § ¢¥àè¨âì ⥪ã騩 ¯®â®ª --- ;--- § ¢¥àè¨âì ⥪ã騩 ¯®â®ª ---
macro app_close macro app_close
{ {
xor eax,eax xor eax,eax
dec eax dec eax
int 0x40 int 0x40
} }
;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª« ¢¨è¨ --- ;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª« ¢¨è¨ ---
macro get_key macro get_key
{ {
mov eax,2 mov eax,2
int 0x40 int 0x40
} }
;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨ --- ;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨ ---
macro get_pressed_button macro get_pressed_button
{ {
mov eax,17 mov eax,17
int 0x40 int 0x40
} }
;--- á®®¡é¨âì á¨á⥬¥ ® ­ ç «¥ ¯¥à¥à¨á®¢ª¨ ®ª­  --- ;--- á®®¡é¨âì á¨á⥬¥ ® ­ ç «¥ ¯¥à¥à¨á®¢ª¨ ®ª­  ---
macro start_draw_window macro start_draw_window
{ {
mov eax,12 mov eax,12
xor ebx,ebx xor ebx,ebx
inc ebx inc ebx
int 0x40 int 0x40
} }
;--- á®®¡é¨âì á¨á⥬¥ ® § ¢¥à襭¨¨ ¯¥à¥à¨á®¢ª¨ ®ª­  --- ;--- á®®¡é¨âì á¨á⥬¥ ® § ¢¥à襭¨¨ ¯¥à¥à¨á®¢ª¨ ®ª­  ---
macro stop_draw_window macro stop_draw_window
{ {
mov eax,12 mov eax,12
mov ebx,2 mov ebx,2
int 0x40 int 0x40
} }
;--- ãáâ ­®¢¨âì ¬ áªã ®¦¨¤ ¥¬ëå ᮡë⨩ --- ;--- ãáâ ­®¢¨âì ¬ áªã ®¦¨¤ ¥¬ëå ᮡë⨩ ---
macro set_events_mask mask macro set_events_mask mask
{ {
mov eax,40 mov eax,40
mov ebx,mask mov ebx,mask
int 0x40 int 0x40
} }
;--- ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¯à®æ¥áᥠ--- ;--- ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¯à®æ¥áᥠ---
macro get_procinfo proc_inf_buf,slot_num macro get_procinfo proc_inf_buf,slot_num
{ {
mov eax,9 mov eax,9
mov ebx,proc_inf_buf mov ebx,proc_inf_buf
if <slot_num> eq <> if <slot_num> eq <>
xor ecx,ecx xor ecx,ecx
dec ecx dec ecx
else else
mov ecx,slot_num mov ecx,slot_num
end if end if
int 0x40 int 0x40
} }
macro get_sys_colors col_buf macro get_sys_colors col_buf
{ {
mov eax,48 mov eax,48
mov ebx,3 mov ebx,3
mov ecx,col_buf mov ecx,col_buf
mov edx,40 mov edx,40
int 0x40 int 0x40
} }
macro get_grab_area macro get_grab_area
{ {
mov eax,48 mov eax,48
mov ebx,7 mov ebx,7
int 0x40 int 0x40
} }
macro get_scin_height macro get_skin_height
{ {
mov eax,48 mov eax,48
mov ebx,4 mov ebx,4
int 0x40 int 0x40
} }
macro min_window macro min_window
{ {
mov eax,18 mov eax,18
mov ebx,10 mov ebx,10
int 0x40 int 0x40
} }
macro activ_window slot_n macro activ_window slot_n
{ {
mov eax,18 mov eax,18
mov ebx,3 mov ebx,3
if <slot_n> eq <> if <slot_n> eq <>
else else
mov ecx,slot_n mov ecx,slot_n
end if end if
int 0x40 int 0x40
} }
macro get_active_window macro get_active_window
{ {
mov eax,18 mov eax,18
mov ebx,7 mov ebx,7
int 0x40 int 0x40
} }
macro delay time macro delay time
{ {
mov eax,5 mov eax,5
if <time> eq <> if <time> eq <>
else else
mov ebx,time mov ebx,time
end if end if
int 0x40 int 0x40
} }
;--- ®¦¨¤ âì ᮡëâ¨ï --- ;--- ®¦¨¤ âì ᮡëâ¨ï ---
macro wait_event redraw,key,button,mouse,ipc,other macro wait_event redraw,key,button,mouse,ipc,other
{ {
mov eax,10 mov eax,10
int 0x40 int 0x40
dec ax dec ax
if <redraw> eq <> if <redraw> eq <>
else else
jz redraw jz redraw
end if end if
dec ax dec ax
if <key> eq <> if <key> eq <>
else else
jz key jz key
end if end if
dec ax dec ax
if <button> eq <> if <button> eq <>
else else
jz button jz button
end if end if
dec ax dec ax
dec ax dec ax
dec ax dec ax
if <mouse> eq <> if <mouse> eq <>
else else
jz mouse jz mouse
end if end if
if <ipc> eq <> if <ipc> eq <>
else else
dec ax dec ax
jz ipc jz ipc
end if end if
if <other> eq <> if <other> eq <>
jmp still jmp still
else else
jmp other jmp other
end if end if
} }
;--- ¯®«ãç¨âì à §¬¥àë íªà ­  --- ;--- ¯®«ãç¨âì à §¬¥àë íªà ­  ---
macro get_screen_size macro get_screen_size
{ {
mov eax,14 mov eax,14
int 0x40 int 0x40
} }
macro get_screen_prop struc_ptr macro get_screen_prop struc_ptr
{ {
mov eax,61 mov eax,61
push eax eax push eax eax
xor ebx,ebx xor ebx,ebx
inc ebx inc ebx
int 0x40 int 0x40
mov [struc_ptr],eax mov [struc_ptr],eax
pop eax pop eax
inc ebx inc ebx
int 0x40 int 0x40
mov [struc_ptr+4],ax mov [struc_ptr+4],ax
pop eax pop eax
inc ebx inc ebx
int 0x40 int 0x40
mov [struc_ptr+6],eax mov [struc_ptr+6],eax
} }
macro resize_mem mem_size macro resize_mem mem_size
{ {
mov eax,64 mov eax,64
xor ebx,ebx xor ebx,ebx
inc ebx inc ebx
if <mem_size> eq <> if <mem_size> eq <>
else else
mov ecx,mem_size mov ecx,mem_size
end if end if
int 0x40 int 0x40
} }
evm_redraw equ 1 evm_redraw equ 1
@ -271,11 +278,11 @@ struc sys_color_table
.grab_button: dd ? ;+8 .grab_button: dd ? ;+8
.grab_button_text: dd ? ;+12 .grab_button_text: dd ? ;+12
.grab_text: dd ? ;+16 .grab_text: dd ? ;+16
.work: dd ? ;+20 .work: dd ? ;+20
.work_button: dd ?;+24 .work_button: dd ?;+24
.work_button_text: dd ? ;+28 .work_button_text: dd ? ;+28
.work_text: dd ? ;+32 .work_text: dd ? ;+32
.work_graph: dd ? ;+36 .work_graph: dd ? ;+36
} }
struc screen_size struc screen_size

View File

@ -1,6 +1,9 @@
window_y=88 ; 01.02.07 - ®¡­®¢«ñ­ editbox
; 31.01.07 - ¨á¯à ¢«¥­  ­¥ª®àà¥ªâ­ ï ®âà¨á®¢ª  ¯à¨ ¡®«ì讬 §­ ç¥­¨¨ ¢ëá®âë ᪨­ 
; ¢ëà ¢­¨¢ ­¨¥ á­¨§ã ®â­®á¨â¥«ì­® à ¡®ç¥© ®¡« á⨠íªà ­ 
window_y=67
;window_x=320 ;window_x=320
window_x=450 window_x=640
include 'macros.inc' include 'macros.inc'
meos_header par meos_header par
use_edit_box use_edit_box
@ -100,11 +103,11 @@ copy_par:
mov ebx,file_info mov ebx,file_info
int 0x40 int 0x40
;cmp eax,0 cmp eax,0
;jg error jl error
bt eax,31 mov [status],run_ok
je error call draw_status
jmp still jmp still
close: close:
app_close app_close
@ -115,14 +118,10 @@ macro cmp_err code,text_ptr
cmp al,code cmp al,code
jne @f jne @f
mov [status],text_ptr mov [status],text_ptr
;jmp .draw_status
@@: @@:
} }
neg eax neg eax
;test al,al
;jz close
cmp_err 3,bad_file_sys cmp_err 3,bad_file_sys
cmp_err 5,file_not_find cmp_err 5,file_not_find
@ -139,40 +138,51 @@ macro cmp_err code,text_ptr
cmp_err 32,many_processes cmp_err 32,many_processes
.draw_status:
call draw_status call draw_status
jmp still jmp still
draw_window: draw_window:
push 48
pop eax
mov ebx,5
int 0x40
mov si,bx
start_draw_window start_draw_window
get_skin_height
mov dx,ax
get_screen_size get_screen_size
mov cx,ax xor ecx,ecx
sub cx,window_y+20 sub cx,window_y+2
sub cx,dx
add cx,si
shl ecx,16 shl ecx,16
mov cx,window_y mov cx,dx
add cx,window_y
shr eax,16 shr eax,16
mov bx,ax mov bx,ax
sub bx,window_x sub bx,window_x
shl ebx,15 shl ebx,15
mov bx,window_x mov bx,window_x
mov edx,[sc.work] mov edx,[sc.work]
or edx,0xb3000000 or edx,0x33000000
xor eax,eax xor eax,eax
mov esi,[sc.grab_text] xor esi,esi
mov edi,hed mov edi,grab_text
int 0x40 int 0x40
get_procinfo app get_procinfo app
mov ax,[app.width] mov eax,[app.width]
sub ax,20 sub eax,20
mov [input_fn.width],eax mov [input_fn.width],eax
mov [run_but.width],ax mov [run_but.width],ax
mov ebx,10000 xor bx,bx
shl ebx,16
mov bx,ax mov bx,ax
add bx,10 add bx,10
mov cx,47 mov cx,45
push cx push cx
shl ecx,16 shl ecx,16
pop cx pop cx
@ -189,8 +199,9 @@ draw_window:
ret ret
draw_status: draw_status:
mov ebx,5*65536+(window_x-5-10) mov ebx,[app.width]
mov ecx,(window_y-39)*65536+12 sub bx,10
mov ecx,(50)*65536+12
mov edx,[sc.work] mov edx,[sc.work]
mov eax,13 mov eax,13
int 0x40 int 0x40
@ -203,22 +214,17 @@ draw_status_text:
inc esi inc esi
jmp @b jmp @b
@@: @@:
mov eax,4 mov ebx,5*65536+(50)
mov ebx,6*65536+(window_y-37)
mov ecx,[sc.work_text] mov ecx,[sc.work_text]
mov eax,4
int 0x40 int 0x40
ret ret
run_but txt_button 0,5,15,30,2,0,0,run_but_text, run_but txt_button 0,5,15,25,2,0,0,run_but_text,
if lang eq ru
run_but_text db '‡€<E280A1>ˆœ',0 run_but_text db '‡€<E280A1>ˆœ',0
else input_fn edit_box 0,5,5,0xffffff,0,0xaaaaaa,0,511,fn,ed_focus+\
run_but_text db 'RUN',0
end if
input_fn edit_box 0,5,10,0xffffff,0,0xaaaaaa,0,511,fn,ed_focus+\
ed_always_focus ed_always_focus
if lang eq ru
hello db '‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ä ©«ã ¨ ­ ¦¬¨â¥ Enter',0 hello db '‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ä ©«ã ¨ ­ ¦¬¨â¥ Enter',0
bad_file_sys db '<27>¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬ ',0 ; 3 bad_file_sys db '<27>¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬ ',0 ; 3
file_not_find db '” ©« ­¥ ­ ©¤¥­',0 ; 5 file_not_find db '” ©« ­¥ ­ ©¤¥­',0 ; 5
@ -228,23 +234,9 @@ device_error db '
out_of_memory db '<27>¥¤®áâ â®ç­® ¯ ¬ïâ¨',0 ; 30 out_of_memory db '<27>¥¤®áâ â®ç­® ¯ ¬ïâ¨',0 ; 30
file_not_executable db '” ©« ­¥ ï¥âáï ¨á¯®«­ï¥¬ë¬',0 ; 31 file_not_executable db '” ©« ­¥ ï¥âáï ¨á¯®«­ï¥¬ë¬',0 ; 31
many_processes db '‘«¨èª®¬ ¬­®£® ¯à®æ¥áᮢ',0 ; 32 many_processes db '‘«¨èª®¬ ¬­®£® ¯à®æ¥áᮢ',0 ; 32
else run_ok db '<27>ணࠬ¬  ãᯥ譮 § ¯ã饭 ',0
hello db 'Enter full path to file and press <Enter>',0 grab_text db '‡€<E280A1>Š <20><>Žƒ<C5BD>€ŒŒ',0
bad_file_sys db 'Unknown file system',0 ; 3
file_not_find db 'File not found',0 ; 5
bad_fat_table db 'FAT table corrupted',0 ; 9
acces_denyied db 'Access denied',0 ; 10
device_error db 'Device error',0 ; 11
out_of_memory db 'Out of memory',0 ; 30
file_not_executable db 'File is not executable',0 ; 31
many_processes db 'Too many processes',0 ; 32
end if
if lang eq ru
hed db 'RUN ®â ¯¥à¢®£® ”¥¢à «ï 2007 £®¤ ',0
else
hed db 'RUN of the first of FEBRUARY 2007 year',0
end if
status dd hello status dd hello
file_info: file_info:

View File

@ -1,13 +1,10 @@
<Lrz> 01.02.2007 „®¡ ¢¨« ¬®¤¥à­¨§¨à®¢ ­­ë© ª®¬¯®­¥­â edit_box,
ã«ãç訫 ¨ ¯¥à¥¯¨á « ç áâì ª®¤ .
RUN - § ¯ã᪠«ª  ¯à®£à ¬¬ ¢ Š®«¨¡à¨Ž‘ ç¥à¥§ 70-î äã­ªæ¨î. RUN - § ¯ã᪠«ª  ¯à®£à ¬¬ ¢ Š®«¨¡à¨Ž‘ ç¥à¥§ 70-î äã­ªæ¨î.
‡ ¯ã᪠¯à®£à ¬¬ ‡ ¯ã᪠¯à®£à ¬¬
‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ¨á¯®«­ï¥¬®¬ã ä ©«ã ¨ ­ ¦¬¨â¥ ª­®¯ªã "‡€<E280A1>ˆœ" ¨«¨ ‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ¨á¯®«­ï¥¬®¬ã ä ©«ã ¨ ­ ¦¬¨â¥ ª­®¯ªã "‡€<E280A1>ˆœ" ¨«¨
ª« ¢¨èã Enter. ª« ¢¨èã Enter.
‡ ¯ã᪠¯à®£à ¬¬ á ¯ à ¬¥âà ¬¨ ‡ ¯ã᪠¯à®£à ¬¬ á ¯ à ¬¥âà ¬¨
<20>®áâ ¢ì⥠¯à®¡¥« ¯®á«¥ ¯ã⨠ª ä ©«ã ¨ ¢¢®¤¨â¥ ¯ à ¬¥âàë. …᫨ ¢ ¯ã⨠ª ä ©«ã <20>®á⠢⥠¯à®¡¥« ¯®á«¥ ¯ã⨠ª ä ©«ã ¨ ¢¢®¤¨â¥ ¯ à ¬¥âàë. …᫨ ¢ ¯ã⨠ª ä ©«ã
¥áâì ¯à®¡¥«ë, ¥£® ­¥®¡å®¤¨¬® ¢ë¤¥«¨âì ª ¢ë窠¬¨ (⮣¤  ¯à®¡¥«®¬ à §¤¥«ïâì ¥áâì ¯à®¡¥«ë, ¥£® ­¥®¡å®¤¨¬® ¢ë¤¥«¨âì ª ¢ë窠¬¨ (⮣¤  ¯à®¡¥«®¬ à §¤¥«ïâì
­¥®¡ï§ â¥«ì­®). ­¥®¡ï§ â¥«ì­®).
<20>ਬ¥àë <20>ਬ¥àë