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 '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
{
use32
org 0x0
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __app_start
dd __app_end
dd __app_end
dd __app_end
db 'MENUET01'
dd 0x01
dd __app_start
dd __app_end
dd __app_end
dd __app_end
if <par_buf> eq <>
dd 0x0
dd 0x0
else
dd par_buf
dd par_buf
end if
if <cur_dir_buf> eq <>
dd 0x0
dd 0x0
else
dd cur_dir_buf
dd cur_dir_buf
end if
}
@ -37,9 +44,9 @@ __app_start:
macro app_end stack_size
{
if <stack_size> eq <>
rb 1024
rb 1024
else
rb stack_size
rb stack_size
end if
__app_end:
}
@ -47,196 +54,196 @@ __app_end:
;--- § ¢¥àè¨âì ⥪ã騩 ¯®â®ª ---
macro app_close
{
xor eax,eax
dec eax
int 0x40
xor eax,eax
dec eax
int 0x40
}
;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª« ¢¨è¨ ---
macro get_key
{
mov eax,2
int 0x40
mov eax,2
int 0x40
}
;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨ ---
macro get_pressed_button
{
mov eax,17
int 0x40
mov eax,17
int 0x40
}
;--- á®®¡é¨âì á¨á⥬¥ ® ­ ç «¥ ¯¥à¥à¨á®¢ª¨ ®ª­  ---
macro start_draw_window
{
mov eax,12
xor ebx,ebx
inc ebx
int 0x40
mov eax,12
xor ebx,ebx
inc ebx
int 0x40
}
;--- á®®¡é¨âì á¨á⥬¥ ® § ¢¥à襭¨¨ ¯¥à¥à¨á®¢ª¨ ®ª­  ---
macro stop_draw_window
{
mov eax,12
mov ebx,2
int 0x40
mov eax,12
mov ebx,2
int 0x40
}
;--- ãáâ ­®¢¨âì ¬ áªã ®¦¨¤ ¥¬ëå ᮡë⨩ ---
macro set_events_mask mask
{
mov eax,40
mov ebx,mask
int 0x40
mov eax,40
mov ebx,mask
int 0x40
}
;--- ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¯à®æ¥áᥠ---
macro get_procinfo proc_inf_buf,slot_num
{
mov eax,9
mov ebx,proc_inf_buf
mov eax,9
mov ebx,proc_inf_buf
if <slot_num> eq <>
xor ecx,ecx
dec ecx
xor ecx,ecx
dec ecx
else
mov ecx,slot_num
mov ecx,slot_num
end if
int 0x40
int 0x40
}
macro get_sys_colors col_buf
{
mov eax,48
mov ebx,3
mov ecx,col_buf
mov edx,40
int 0x40
mov eax,48
mov ebx,3
mov ecx,col_buf
mov edx,40
int 0x40
}
macro get_grab_area
{
mov eax,48
mov ebx,7
int 0x40
mov eax,48
mov ebx,7
int 0x40
}
macro get_scin_height
macro get_skin_height
{
mov eax,48
mov ebx,4
int 0x40
mov eax,48
mov ebx,4
int 0x40
}
macro min_window
{
mov eax,18
mov ebx,10
int 0x40
mov eax,18
mov ebx,10
int 0x40
}
macro activ_window slot_n
{
mov eax,18
mov ebx,3
mov eax,18
mov ebx,3
if <slot_n> eq <>
else
mov ecx,slot_n
mov ecx,slot_n
end if
int 0x40
int 0x40
}
macro get_active_window
{
mov eax,18
mov ebx,7
int 0x40
mov eax,18
mov ebx,7
int 0x40
}
macro delay time
{
mov eax,5
mov eax,5
if <time> eq <>
else
mov ebx,time
mov ebx,time
end if
int 0x40
int 0x40
}
;--- ®¦¨¤ âì ᮡëâ¨ï ---
macro wait_event redraw,key,button,mouse,ipc,other
{
mov eax,10
int 0x40
dec ax
mov eax,10
int 0x40
dec ax
if <redraw> eq <>
else
jz redraw
jz redraw
end if
dec ax
dec ax
if <key> eq <>
else
jz key
jz key
end if
dec ax
dec ax
if <button> eq <>
else
jz button
jz button
end if
dec ax
dec ax
dec ax
dec ax
dec ax
dec ax
if <mouse> eq <>
else
jz mouse
jz mouse
end if
if <ipc> eq <>
else
dec ax
jz ipc
dec ax
jz ipc
end if
if <other> eq <>
jmp still
jmp still
else
jmp other
jmp other
end if
}
;--- ¯®«ãç¨âì à §¬¥àë íªà ­  ---
macro get_screen_size
{
mov eax,14
int 0x40
mov eax,14
int 0x40
}
macro get_screen_prop struc_ptr
{
mov eax,61
push eax eax
xor ebx,ebx
inc ebx
int 0x40
mov [struc_ptr],eax
pop eax
inc ebx
int 0x40
mov [struc_ptr+4],ax
pop eax
inc ebx
int 0x40
mov [struc_ptr+6],eax
mov eax,61
push eax eax
xor ebx,ebx
inc ebx
int 0x40
mov [struc_ptr],eax
pop eax
inc ebx
int 0x40
mov [struc_ptr+4],ax
pop eax
inc ebx
int 0x40
mov [struc_ptr+6],eax
}
macro resize_mem mem_size
{
mov eax,64
xor ebx,ebx
inc ebx
mov eax,64
xor ebx,ebx
inc ebx
if <mem_size> eq <>
else
mov ecx,mem_size
mov ecx,mem_size
end if
int 0x40
int 0x40
}
evm_redraw equ 1
@ -271,11 +278,11 @@ struc sys_color_table
.grab_button: dd ? ;+8
.grab_button_text: dd ? ;+12
.grab_text: dd ? ;+16
.work: dd ? ;+20
.work: dd ? ;+20
.work_button: dd ?;+24
.work_button_text: dd ? ;+28
.work_text: dd ? ;+32
.work_graph: dd ? ;+36
.work_text: dd ? ;+32
.work_graph: dd ? ;+36
}
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=450
window_x=640
include 'macros.inc'
meos_header par
use_edit_box
@ -100,11 +103,11 @@ copy_par:
mov ebx,file_info
int 0x40
;cmp eax,0
;jg error
bt eax,31
je error
jmp still
cmp eax,0
jl error
mov [status],run_ok
call draw_status
jmp still
close:
app_close
@ -115,14 +118,10 @@ macro cmp_err code,text_ptr
cmp al,code
jne @f
mov [status],text_ptr
;jmp .draw_status
@@:
}
neg eax
;test al,al
;jz close
cmp_err 3,bad_file_sys
cmp_err 5,file_not_find
@ -139,40 +138,51 @@ macro cmp_err code,text_ptr
cmp_err 32,many_processes
.draw_status:
call draw_status
jmp still
draw_window:
push 48
pop eax
mov ebx,5
int 0x40
mov si,bx
start_draw_window
get_skin_height
mov dx,ax
get_screen_size
mov cx,ax
sub cx,window_y+20
xor ecx,ecx
sub cx,window_y+2
sub cx,dx
add cx,si
shl ecx,16
mov cx,window_y
mov cx,dx
add cx,window_y
shr eax,16
mov bx,ax
sub bx,window_x
shl ebx,15
mov bx,window_x
mov edx,[sc.work]
or edx,0xb3000000
or edx,0x33000000
xor eax,eax
mov esi,[sc.grab_text]
mov edi,hed
xor esi,esi
mov edi,grab_text
int 0x40
get_procinfo app
mov ax,[app.width]
sub ax,20
mov eax,[app.width]
sub eax,20
mov [input_fn.width],eax
mov [run_but.width],ax
mov ebx,10000
xor bx,bx
shl ebx,16
mov bx,ax
add bx,10
mov cx,47
mov cx,45
push cx
shl ecx,16
pop cx
@ -189,8 +199,9 @@ draw_window:
ret
draw_status:
mov ebx,5*65536+(window_x-5-10)
mov ecx,(window_y-39)*65536+12
mov ebx,[app.width]
sub bx,10
mov ecx,(50)*65536+12
mov edx,[sc.work]
mov eax,13
int 0x40
@ -203,22 +214,17 @@ draw_status_text:
inc esi
jmp @b
@@:
mov eax,4
mov ebx,6*65536+(window_y-37)
mov ebx,5*65536+(50)
mov ecx,[sc.work_text]
mov eax,4
int 0x40
ret
run_but txt_button 0,5,15,30,2,0,0,run_but_text,
if lang eq ru
run_but txt_button 0,5,15,25,2,0,0,run_but_text,
run_but_text db '‡€<E280A1>ˆœ',0
else
run_but_text db 'RUN',0
end if
input_fn edit_box 0,5,10,0xffffff,0,0xaaaaaa,0,511,fn,ed_focus+\
input_fn edit_box 0,5,5,0xffffff,0,0xaaaaaa,0,511,fn,ed_focus+\
ed_always_focus
if lang eq ru
hello db '‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ä ©«ã ¨ ­ ¦¬¨â¥ Enter',0
bad_file_sys db '<27>¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬ ',0 ; 3
file_not_find db '” ©« ­¥ ­ ©¤¥­',0 ; 5
@ -228,23 +234,9 @@ device_error db '
out_of_memory db '<27>¥¤®áâ â®ç­® ¯ ¬ïâ¨',0 ; 30
file_not_executable db '” ©« ­¥ ï¥âáï ¨á¯®«­ï¥¬ë¬',0 ; 31
many_processes db '‘«¨èª®¬ ¬­®£® ¯à®æ¥áᮢ',0 ; 32
else
hello db 'Enter full path to file and press <Enter>',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
run_ok db '<27>ணࠬ¬  ãᯥ譮 § ¯ã饭 ',0
grab_text db '‡€<E280A1>Š <20><>Žƒ<C5BD>€ŒŒ',0
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
file_info:

View File

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