forked from KolibriOS/kolibrios
update 'load_lib.mac', update 'info3ds', fix 'kol_f_edit'
git-svn-id: svn://kolibrios.org@8083 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
dcf43649a6
commit
06339c5e4e
@ -231,12 +231,12 @@ start:
|
|||||||
stdcall [glEnable], GL_NORMALIZE ;¤¥« ¬ ®à¬ «¨ ®¤¨ ª®¢®© ¢¥«¨ç¨ë ¢® ¨§¡¥¦ ¨¥ àâ¥ä ªâ®¢
|
stdcall [glEnable], GL_NORMALIZE ;¤¥« ¬ ®à¬ «¨ ®¤¨ ª®¢®© ¢¥«¨ç¨ë ¢® ¨§¡¥¦ ¨¥ àâ¥ä ªâ®¢
|
||||||
stdcall [glClearColor], [color_bk+8],[color_bk+4],[color_bk],0.0
|
stdcall [glClearColor], [color_bk+8],[color_bk+4],[color_bk],0.0
|
||||||
stdcall [glShadeModel], GL_SMOOTH
|
stdcall [glShadeModel], GL_SMOOTH
|
||||||
stdcall [gluNewQuadric]
|
call [gluNewQuadric]
|
||||||
mov [qObj],eax
|
mov [qObj],eax
|
||||||
|
|
||||||
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
|
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
|
||||||
mov eax,[eax] ;eax -> ZBuffer
|
mov eax,[eax] ;eax -> ZBuffer
|
||||||
mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf
|
mov eax,[eax+ZBuffer.pbuf]
|
||||||
mov dword[buf_ogl],eax
|
mov dword[buf_ogl],eax
|
||||||
|
|
||||||
;open file from cmd line
|
;open file from cmd line
|
||||||
@ -1392,9 +1392,6 @@ align 4
|
|||||||
w_scr_t1 scrollbar 16,0, 3,0, 15, 100, 0,0, 0,0,0, 1
|
w_scr_t1 scrollbar 16,0, 3,0, 15, 100, 0,0, 0,0,0, 1
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
|
|
||||||
;sizeof.TinyGLContext = 28
|
|
||||||
|
|
||||||
qObj dd 0
|
qObj dd 0
|
||||||
|
|
||||||
light_position dd 0.0, 0.0, -2.0, 1.0 ; <20> ᯮ«®¦¥¨¥ ¨áâ®ç¨ª [0][1][2]
|
light_position dd 0.0, 0.0, -2.0, 1.0 ; <20> ᯮ«®¦¥¨¥ ¨áâ®ç¨ª [0][1][2]
|
||||||
@ -1407,13 +1404,14 @@ white_light dd 0.8, 0.8, 0.8, 1.0 ;
|
|||||||
lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ; <20> à ¬¥âàë ä®®¢®£® ®á¢¥é¥¨ï
|
lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ; <20> à ¬¥âàë ä®®¢®£® ®á¢¥é¥¨ï
|
||||||
|
|
||||||
if lang eq ru
|
if lang eq ru
|
||||||
capt db 'info 3ds ¢¥àá¨ï 23.03.19',0 ;¯®¤¯¨áì ®ª
|
capt db 'info 3ds ¢¥àá¨ï 29.09.20',0 ;¯®¤¯¨áì ®ª
|
||||||
else
|
else
|
||||||
capt db 'info 3ds version 23.03.19',0 ;window caption
|
capt db 'info 3ds version 29.09.20',0 ;window caption
|
||||||
end if
|
end if
|
||||||
|
|
||||||
align 16
|
align 16
|
||||||
i_end:
|
i_end:
|
||||||
|
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||||
procinfo process_information
|
procinfo process_information
|
||||||
run_file_70 FileInfoBlock
|
run_file_70 FileInfoBlock
|
||||||
sc system_colors
|
sc system_colors
|
||||||
|
@ -227,12 +227,12 @@ start:
|
|||||||
stdcall [glEnable], GL_NORMALIZE ;¤¥« ¬ ®à¬ «¨ ®¤¨ ª®¢®© ¢¥«¨ç¨ë ¢® ¨§¡¥¦ ¨¥ àâ¥ä ªâ®¢
|
stdcall [glEnable], GL_NORMALIZE ;¤¥« ¬ ®à¬ «¨ ®¤¨ ª®¢®© ¢¥«¨ç¨ë ¢® ¨§¡¥¦ ¨¥ àâ¥ä ªâ®¢
|
||||||
stdcall [glClearColor], [color_bk+8],[color_bk+4],[color_bk],0.0
|
stdcall [glClearColor], [color_bk+8],[color_bk+4],[color_bk],0.0
|
||||||
stdcall [glShadeModel], GL_SMOOTH
|
stdcall [glShadeModel], GL_SMOOTH
|
||||||
stdcall [gluNewQuadric]
|
call [gluNewQuadric]
|
||||||
mov [qObj],eax
|
mov [qObj],eax
|
||||||
|
|
||||||
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
|
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
|
||||||
mov eax,[eax] ;eax -> ZBuffer
|
mov eax,[eax] ;eax -> ZBuffer
|
||||||
mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf
|
mov eax,[eax+ZBuffer.pbuf]
|
||||||
mov dword[buf_ogl],eax
|
mov dword[buf_ogl],eax
|
||||||
|
|
||||||
;open file from cmd line
|
;open file from cmd line
|
||||||
@ -287,14 +287,14 @@ mouse:
|
|||||||
stdcall [tl_node_get_data],tree1
|
stdcall [tl_node_get_data],tree1
|
||||||
or eax,eax
|
or eax,eax
|
||||||
jz .end_d
|
jz .end_d
|
||||||
mov ebx,dword[eax]
|
mov ebx,[eax]
|
||||||
add ebx,dword[open_file_data] ;¯®«ãç ¥¬ § 票¥ ᤢ¨£ ¢ ¯ ¬ïâ¨
|
add ebx,dword[open_file_data] ;¯®«ãç ¥¬ § 票¥ ᤢ¨£ ¢ ¯ ¬ïâ¨
|
||||||
cmp word[ebx],CHUNK_OBJBLOCK
|
cmp word[ebx],CHUNK_OBJBLOCK
|
||||||
jne .end_d
|
jne .end_d
|
||||||
|
|
||||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||||
mov ebx,eax
|
mov ebx,eax
|
||||||
shr ebx,16 ;mouse.x
|
sar ebx,16 ;mouse.x
|
||||||
cmp ebx,3d_wnd_l
|
cmp ebx,3d_wnd_l
|
||||||
jg @f
|
jg @f
|
||||||
mov ebx,3d_wnd_l
|
mov ebx,3d_wnd_l
|
||||||
@ -304,7 +304,7 @@ mouse:
|
|||||||
jle @f
|
jle @f
|
||||||
mov ebx,3d_wnd_w
|
mov ebx,3d_wnd_w
|
||||||
@@:
|
@@:
|
||||||
and eax,0xffff ;mouse.y
|
movsx eax,ax ;mouse.y
|
||||||
cmp eax,3d_wnd_t
|
cmp eax,3d_wnd_t
|
||||||
jg @f
|
jg @f
|
||||||
mov eax,3d_wnd_t
|
mov eax,3d_wnd_t
|
||||||
@ -346,13 +346,13 @@ mouse:
|
|||||||
;mouse l. but. press
|
;mouse l. but. press
|
||||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||||
mov ebx,eax
|
mov ebx,eax
|
||||||
shr ebx,16 ;mouse.x
|
sar ebx,16 ;mouse.x
|
||||||
cmp ebx,3d_wnd_l
|
cmp ebx,3d_wnd_l
|
||||||
jl .end_d
|
jl .end_d
|
||||||
sub ebx,3d_wnd_l
|
sub ebx,3d_wnd_l
|
||||||
cmp ebx,3d_wnd_w
|
cmp ebx,3d_wnd_w
|
||||||
jg .end_d
|
jg .end_d
|
||||||
and eax,0xffff ;mouse.y
|
movsx eax,ax ;mouse.y
|
||||||
cmp eax,3d_wnd_t
|
cmp eax,3d_wnd_t
|
||||||
jl .end_d
|
jl .end_d
|
||||||
sub eax,3d_wnd_t
|
sub eax,3d_wnd_t
|
||||||
@ -363,7 +363,7 @@ mouse:
|
|||||||
mov dword[mouse_y],eax
|
mov dword[mouse_y],eax
|
||||||
.end_d:
|
.end_d:
|
||||||
|
|
||||||
stdcall [tl_mouse], dword tree1
|
stdcall [tl_mouse], tree1
|
||||||
stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
|
stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
|
||||||
pop ebx eax
|
pop ebx eax
|
||||||
ret
|
ret
|
||||||
@ -378,19 +378,18 @@ timer_funct:
|
|||||||
stdcall [tl_node_get_data],tree1
|
stdcall [tl_node_get_data],tree1
|
||||||
or eax,eax
|
or eax,eax
|
||||||
jz .end_f
|
jz .end_f
|
||||||
mov edi,eax
|
lea edi,[eax+list_offs_obj3d]
|
||||||
add edi,list_offs_obj3d
|
|
||||||
mov ebx,eax
|
mov ebx,eax
|
||||||
mov eax,dword[ebx]
|
mov eax,[ebx]
|
||||||
mov ecx,dword[ebx+4] ;à §¬¥à ¡«®ª
|
mov ecx,[ebx+4] ;à §¬¥à ¡«®ª
|
||||||
stdcall hex_in_str, txt_3ds_offs.dig, eax,8
|
stdcall hex_in_str, txt_3ds_offs.dig, eax,8
|
||||||
stdcall hex_in_str, txt_3ds_offs.siz, ecx,8
|
stdcall hex_in_str, txt_3ds_offs.siz, ecx,8
|
||||||
|
|
||||||
add eax,dword[open_file_data] ;¯®«ãç ¥¬ § 票¥ ᤢ¨£ ¢ ¯ ¬ïâ¨
|
add eax,[open_file_data] ;¯®«ãç ¥¬ § 票¥ ᤢ¨£ ¢ ¯ ¬ïâ¨
|
||||||
cmp dword[offs_last_timer],eax
|
cmp [offs_last_timer],eax
|
||||||
je .end_f
|
je .end_f
|
||||||
;¥á«¨ ¢ë¤¥«¥ë© ¡«®ª ¤ ëå ¥ ᮢ¯ ¤ ¥â á ¯®á«¥¤¨¬ § ¯®¬¥ë¬
|
;¥á«¨ ¢ë¤¥«¥ë© ¡«®ª ¤ ëå ¥ ᮢ¯ ¤ ¥â á ¯®á«¥¤¨¬ § ¯®¬¥ë¬
|
||||||
mov dword[offs_last_timer],eax
|
mov [offs_last_timer],eax
|
||||||
|
|
||||||
cmp word[eax],CHUNK_OBJBLOCK
|
cmp word[eax],CHUNK_OBJBLOCK
|
||||||
jne .end_oblo
|
jne .end_oblo
|
||||||
@ -422,7 +421,7 @@ timer_funct:
|
|||||||
|
|
||||||
stdcall buf_draw_beg, buf_ogl
|
stdcall buf_draw_beg, buf_ogl
|
||||||
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_3ds_offs,5,35,0xb000
|
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_3ds_offs,5,35,0xb000
|
||||||
mov edx,dword[ebx+list_offs_p_data]
|
mov edx,[ebx+list_offs_p_data]
|
||||||
or edx,edx ;ᬮâਬ ¥áâì «¨ ®¯¨á ¨¥ ¡«®ª
|
or edx,edx ;ᬮâਬ ¥áâì «¨ ®¯¨á ¨¥ ¡«®ª
|
||||||
jz .no_info
|
jz .no_info
|
||||||
stdcall [buf2d_draw_text], buf_ogl, buf_1,edx,5,45,0xb000
|
stdcall [buf2d_draw_text], buf_ogl, buf_1,edx,5,45,0xb000
|
||||||
@ -1043,8 +1042,7 @@ proc add_3ds_object, icon:dword, level:dword, size_bl:dword, info_bl:dword
|
|||||||
.no_capt:
|
.no_capt:
|
||||||
mov ecx,(sizeof.obj_3d)/4
|
mov ecx,(sizeof.obj_3d)/4
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
mov edi,buffer
|
mov edi,buffer+list_offs_obj3d
|
||||||
add edi,list_offs_obj3d
|
|
||||||
rep stosd
|
rep stosd
|
||||||
stdcall [tl_node_add], tree1, ebx, buffer
|
stdcall [tl_node_add], tree1, ebx, buffer
|
||||||
stdcall [tl_cur_next], tree1
|
stdcall [tl_cur_next], tree1
|
||||||
@ -1459,9 +1457,6 @@ align 4
|
|||||||
w_scr_t1 scrollbar 16,0, 3,0, 15, 100, 0,0, 0,0,0, 1
|
w_scr_t1 scrollbar 16,0, 3,0, 15, 100, 0,0, 0,0,0, 1
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
|
|
||||||
;sizeof.TinyGLContext = 28
|
|
||||||
|
|
||||||
qObj dd 0
|
qObj dd 0
|
||||||
|
|
||||||
light_position dd 0.0, 0.0, -2.0, 1.0 ; <20> ᯮ«®¦¥¨¥ ¨áâ®ç¨ª [0][1][2]
|
light_position dd 0.0, 0.0, -2.0, 1.0 ; <20> ᯮ«®¦¥¨¥ ¨áâ®ç¨ª [0][1][2]
|
||||||
@ -1474,13 +1469,14 @@ white_light dd 0.8, 0.8, 0.8, 1.0 ;
|
|||||||
lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ; <20> à ¬¥âàë ä®®¢®£® ®á¢¥é¥¨ï
|
lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ; <20> à ¬¥âàë ä®®¢®£® ®á¢¥é¥¨ï
|
||||||
|
|
||||||
if lang eq ru
|
if lang eq ru
|
||||||
capt db 'info 3ds [user] ¢¥àá¨ï 23.03.19',0 ;¯®¤¯¨áì ®ª
|
capt db 'info 3ds [user] ¢¥àá¨ï 29.09.20',0 ;¯®¤¯¨áì ®ª
|
||||||
else
|
else
|
||||||
capt db 'info 3ds [user] version 23.03.19',0 ;window caption
|
capt db 'info 3ds [user] version 29.09.20',0 ;window caption
|
||||||
end if
|
end if
|
||||||
|
|
||||||
align 16
|
align 16
|
||||||
i_end:
|
i_end:
|
||||||
|
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||||
procinfo process_information
|
procinfo process_information
|
||||||
run_file_70 FileInfoBlock
|
run_file_70 FileInfoBlock
|
||||||
sc system_colors
|
sc system_colors
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
; áâàãªâãàë ¨ äãªæ¨¨ ¤«ï à¨á®¢ ¨ï 3d ®¡ê¥ªâ®¢
|
; áâàãªâãàë ¨ äãªæ¨¨ ¤«ï à¨á®¢ ¨ï 3d ®¡ê¥ªâ®¢
|
||||||
;
|
;
|
||||||
|
|
||||||
offs_zbuf_pbuf equ 24 ;const. from 'zbuffer.inc'
|
include '../../develop/libraries/TinyGL/asm_fork/zbuffer.inc'
|
||||||
|
|
||||||
struct obj_3d
|
struct obj_3d
|
||||||
poi_data dd ? ;㪠§ â¥«ì ª®®à¤¨ âë ¢¥àè¨
|
poi_data dd ? ;㪠§ â¥«ì ª®®à¤¨ âë ¢¥àè¨
|
||||||
@ -356,8 +356,7 @@ pushad
|
|||||||
mov ecx,[ecx+obj_3d.poi_data]
|
mov ecx,[ecx+obj_3d.poi_data]
|
||||||
align 4
|
align 4
|
||||||
@@:
|
@@:
|
||||||
mov edi,ebp
|
lea edi,[ebp-36] ;tbl2
|
||||||
sub edi,36 ;tbl2
|
|
||||||
movzx esi,word[edx] ;1-ï ¢¥àè¨
|
movzx esi,word[edx] ;1-ï ¢¥àè¨
|
||||||
imul esi,12
|
imul esi,12
|
||||||
add esi,ecx
|
add esi,ecx
|
||||||
@ -377,8 +376,7 @@ align 4
|
|||||||
movsd
|
movsd
|
||||||
movsd
|
movsd
|
||||||
|
|
||||||
mov esi,ebp
|
lea esi,[ebp-72] ;tbl1
|
||||||
sub esi,72 ;tbl1
|
|
||||||
sub edi,36 ;tbl2
|
sub edi,36 ;tbl2
|
||||||
;v1 <-> v2
|
;v1 <-> v2
|
||||||
fld dword[edi+12]
|
fld dword[edi+12]
|
||||||
@ -806,7 +804,7 @@ proc draw_3d uses eax ebx ecx edi, o_data:dword
|
|||||||
cmp dword[edi+obj_3d.poi_count],2
|
cmp dword[edi+obj_3d.poi_count],2
|
||||||
jl .end_f
|
jl .end_f
|
||||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;®ç¨á⨬ ¡ãä¥à 梥⠨ £«ã¡¨ë
|
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;®ç¨á⨬ ¡ãä¥à 梥⠨ £«ã¡¨ë
|
||||||
stdcall [glPushMatrix]
|
call [glPushMatrix]
|
||||||
bt dword[draw_mode],bit_light
|
bt dword[draw_mode],bit_light
|
||||||
jnc @f
|
jnc @f
|
||||||
call SetLight
|
call SetLight
|
||||||
@ -976,10 +974,10 @@ if version_edit eq 1
|
|||||||
stdcall [glEnd]
|
stdcall [glEnd]
|
||||||
|
|
||||||
stdcall [glColor3ub],[color_select+2],[color_select+1],[color_select]
|
stdcall [glColor3ub],[color_select+2],[color_select+1],[color_select]
|
||||||
stdcall [glPushMatrix]
|
call [glPushMatrix]
|
||||||
stdcall [glTranslatef], [eax],[eax+4],[eax+8]
|
stdcall [glTranslatef], [eax],[eax+4],[eax+8]
|
||||||
stdcall [gluSphere], [qObj], [sph_radius], 8,8
|
stdcall [gluSphere], [qObj], [sph_radius], 8,8
|
||||||
stdcall [glPopMatrix]
|
call [glPopMatrix]
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
;à¨á®¢ ¨¥ ¢ë¤¥«¥ëå â®ç¥ª
|
;à¨á®¢ ¨¥ ¢ë¤¥«¥ëå â®ç¥ª
|
||||||
@ -997,10 +995,10 @@ align 4
|
|||||||
jne .next_sel
|
jne .next_sel
|
||||||
stdcall [tl_node_poi_get_data], tree3,ebx
|
stdcall [tl_node_poi_get_data], tree3,ebx
|
||||||
mov eax,[eax]
|
mov eax,[eax]
|
||||||
stdcall [glPushMatrix]
|
call [glPushMatrix]
|
||||||
stdcall [glTranslatef], [eax],[eax+4],[eax+8]
|
stdcall [glTranslatef], [eax],[eax+4],[eax+8]
|
||||||
stdcall [gluSphere], [qObj], [sph_radius], 4,4
|
stdcall [gluSphere], [qObj], [sph_radius], 4,4
|
||||||
stdcall [glPopMatrix]
|
call [glPopMatrix]
|
||||||
dec ecx
|
dec ecx
|
||||||
jz .end_select
|
jz .end_select
|
||||||
.next_sel:
|
.next_sel:
|
||||||
@ -1009,14 +1007,14 @@ align 4
|
|||||||
.end_select:
|
.end_select:
|
||||||
end if
|
end if
|
||||||
|
|
||||||
stdcall [glPopMatrix]
|
call [glPopMatrix]
|
||||||
if version_edit eq 1
|
if version_edit eq 1
|
||||||
cmp dword[obj_poi_sel_c],0
|
cmp dword[obj_poi_sel_c],0
|
||||||
je @f
|
je @f
|
||||||
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_select_vert,5,3,[color_select]
|
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_select_vert,5,3,[color_select]
|
||||||
@@:
|
@@:
|
||||||
end if
|
end if
|
||||||
stdcall [kosglSwapBuffers]
|
call [kosglSwapBuffers]
|
||||||
.end_f:
|
.end_f:
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
@ -1,13 +1,7 @@
|
|||||||
use32
|
use32
|
||||||
org 0x0
|
org 0
|
||||||
db 'MENUET01'
|
db 'MENUET01'
|
||||||
dd 0x1
|
dd 1,start,i_end,mem,stacktop,buf_cmd_lin,sys_path
|
||||||
dd start
|
|
||||||
dd i_end
|
|
||||||
dd mem
|
|
||||||
dd stacktop
|
|
||||||
dd buf_cmd_lin
|
|
||||||
dd sys_path
|
|
||||||
|
|
||||||
include '../../macros.inc'
|
include '../../macros.inc'
|
||||||
include '../../proc32.inc'
|
include '../../proc32.inc'
|
||||||
@ -21,7 +15,7 @@ include 'obj_codes.inc'
|
|||||||
|
|
||||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
|
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
|
||||||
|
|
||||||
hed db 'kol_f_edit 16.11.15',0
|
hed db 'kol_f_edit 29.09.20',0
|
||||||
|
|
||||||
sizeof.TreeList equ 20 ;need for element 'tree_list'
|
sizeof.TreeList equ 20 ;need for element 'tree_list'
|
||||||
|
|
||||||
@ -1337,34 +1331,34 @@ obj_m_win dd 0 ;
|
|||||||
;
|
;
|
||||||
if 1 ;lang eq ru
|
if 1 ;lang eq ru
|
||||||
|
|
||||||
err_message_found_lib0 db '<27>¥ ©¤¥ ¡¨¡«¨®â¥ª box_lib.obj',0 ;áâப , ª®â®à ï ¡ã¤¥â ¢ áä®à¬¨à®¢ ®¬ ®ª¥, ¥á«¨ ¡¨¡«¨®â¥ª ¥ ¡ã¤¥â ©¤¥
|
err_message_found_lib0 db '<27>¥ ©¤¥ ¡¨¡«¨®â¥ª box_lib.obj',39,'" -tE',0
|
||||||
err_message_import0 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0
|
err_message_import0 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',39,'" -tW',0
|
||||||
err_message_found_lib1 db '<27>¥ ©¤¥ ¡¨¡«¨®â¥ª proc_lib.obj',0
|
err_message_found_lib1 db '<27>¥ ©¤¥ ¡¨¡«¨®â¥ª proc_lib.obj',39,'" -tE',0
|
||||||
err_message_import1 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ proc_lib.obj',0
|
err_message_import1 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ proc_lib.obj',39,'" -tW',0
|
||||||
err_message_found_lib2 db '<27>¥ 㤠«®áì ©â¨ ¡¨¡«¨®â¥ªã buf2d.obj',0
|
err_message_found_lib2 db '<27>¥ 㤠«®áì ©â¨ ¡¨¡«¨®â¥ªã buf2d.obj',39,'" -tE',0
|
||||||
err_message_import2 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ buf2d.obj',0
|
err_message_import2 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ buf2d.obj',39,'" -tW',0
|
||||||
err_message_found_lib3 db '<27>¥ 㤠«®áì ©â¨ ¡¨¡«¨®â¥ªã libimg.obj',0
|
err_message_found_lib3 db '<27>¥ 㤠«®áì ©â¨ ¡¨¡«¨®â¥ªã libimg.obj',39,'" -tE',0
|
||||||
err_message_import3 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ libimg.obj',0
|
err_message_import3 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ libimg.obj',39,'" -tW',0
|
||||||
err_message_found_lib4 db '<27>¥ 㤠«®áì ©â¨ ¡¨¡«¨®â¥ªã msgbox.obj',0
|
err_message_found_lib4 db '<27>¥ 㤠«®áì ©â¨ ¡¨¡«¨®â¥ªã msgbox.obj',39,'" -tE',0
|
||||||
err_message_import4 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ msgbox.obj',0
|
err_message_import4 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ msgbox.obj',39,'" -tW',0
|
||||||
|
|
||||||
head_f_i:
|
head_f_i:
|
||||||
head_f_l db '‘¨á⥬ ï ®è¨¡ª ',0 ;§ £®«®¢®ª ®ª , ¯à¨ ¢®§¨ª®¢¥¨¨ ®è¨¡ª¨
|
head_f_l db '"‘¨á⥬ ï ®è¨¡ª ',0 ;§ £®«®¢®ª ®ª , ¯à¨ ¢®§¨ª®¢¥¨¨ ®è¨¡ª¨
|
||||||
else
|
else
|
||||||
|
|
||||||
err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0
|
err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',39,'" -tE',0
|
||||||
err_message_import0 db 'Error on load import library box_lib.obj',0
|
err_message_import0 db 'Error on load import library box_lib.obj',39,'" -tW',0
|
||||||
err_message_found_lib1 db 'Sorry I cannot found library proc_lib.obj',0
|
err_message_found_lib1 db 'Sorry I cannot found library proc_lib.obj',39,'" -tE',0
|
||||||
err_message_import1 db 'Error on load import library proc_lib.obj',0
|
err_message_import1 db 'Error on load import library proc_lib.obj',39,'" -tW',0
|
||||||
err_message_found_lib2 db 'Sorry I cannot found library buf2d.obj',0
|
err_message_found_lib2 db 'Sorry I cannot found library buf2d.obj',39,'" -tE',0
|
||||||
err_message_import2 db 'Error on load import library buf2d.obj',0
|
err_message_import2 db 'Error on load import library buf2d.obj',39,'" -tW',0
|
||||||
err_message_found_lib3 db 'Sorry I cannot found library libimg.obj',0
|
err_message_found_lib3 db 'Sorry I cannot found library libimg.obj',39,'" -tE',0
|
||||||
err_message_import3 db 'Error on load import library libimg.obj',0
|
err_message_import3 db 'Error on load import library libimg.obj',39,'" -tW',0
|
||||||
err_message_found_lib4 db 'Sorry I cannot found library msgbox.obj',0
|
err_message_found_lib4 db 'Sorry I cannot found library msgbox.obj',39,'" -tE',0
|
||||||
err_message_import4 db 'Error on load import library msgbox.obj',0
|
err_message_import4 db 'Error on load import library msgbox.obj',39,'" -tW',0
|
||||||
|
|
||||||
head_f_i:
|
head_f_i:
|
||||||
head_f_l db 'System error',0 ;§ £®«®¢®ª ®ª , ¯à¨ ¢®§¨ª®¢¥¨¨ ®è¨¡ª¨
|
head_f_l db '"System error',0 ;§ £®«®¢®ª ®ª , ¯à¨ ¢®§¨ª®¢¥¨¨ ®è¨¡ª¨
|
||||||
end if
|
end if
|
||||||
|
|
||||||
system_dir0 db '/sys/lib/'
|
system_dir0 db '/sys/lib/'
|
||||||
@ -1492,7 +1486,7 @@ import_box_lib:
|
|||||||
ted_but_undo dd sz_ted_but_undo
|
ted_but_undo dd sz_ted_but_undo
|
||||||
ted_but_redo dd sz_ted_but_redo
|
ted_but_redo dd sz_ted_but_redo
|
||||||
ted_but_reverse dd sz_ted_but_reverse
|
ted_but_reverse dd sz_ted_but_reverse
|
||||||
ted_but_find_next dd sz_ted_but_find_next
|
ted_but_find dd sz_ted_but_find
|
||||||
ted_text_colored dd sz_ted_text_colored
|
ted_text_colored dd sz_ted_text_colored
|
||||||
;version_text_edit dd sz_ted_version
|
;version_text_edit dd sz_ted_version
|
||||||
|
|
||||||
@ -1558,7 +1552,7 @@ dd 0,0
|
|||||||
sz_ted_but_undo db 'ted_but_undo',0
|
sz_ted_but_undo db 'ted_but_undo',0
|
||||||
sz_ted_but_redo db 'ted_but_redo',0
|
sz_ted_but_redo db 'ted_but_redo',0
|
||||||
sz_ted_but_reverse db 'ted_but_reverse',0
|
sz_ted_but_reverse db 'ted_but_reverse',0
|
||||||
sz_ted_but_find_next db 'ted_but_find_next',0
|
sz_ted_but_find db 'ted_but_find',0
|
||||||
sz_ted_text_colored db 'ted_text_colored',0
|
sz_ted_text_colored db 'ted_text_colored',0
|
||||||
;sz_ted_version db 'version_text_edit',0
|
;sz_ted_version db 'version_text_edit',0
|
||||||
|
|
||||||
|
@ -81,36 +81,18 @@
|
|||||||
|
|
||||||
;myimport:
|
;myimport:
|
||||||
;
|
;
|
||||||
;edit_box_draw dd aEdit_box_draw
|
;edit_box_draw dd aEdit_box_draw
|
||||||
;edit_box_key dd aEdit_box_key
|
;edit_box_key dd aEdit_box_key
|
||||||
;edit_box_mouse dd aEdit_box_mouse
|
;edit_box_mouse dd aEdit_box_mouse
|
||||||
;version_ed dd aVersion_ed
|
;version_ed dd aVersion_ed
|
||||||
;
|
; dd 0,0
|
||||||
;check_box_draw dd aCheck_box_draw
|
|
||||||
;check_box_mouse dd aCheck_box_mouse
|
|
||||||
;version_ch dd aVersion_ch
|
|
||||||
;
|
|
||||||
;option_box_draw dd aOption_box_draw
|
|
||||||
;option_box_mouse dd aOption_box_mouse
|
|
||||||
;version_op dd aVersion_op
|
|
||||||
|
|
||||||
; dd 0
|
|
||||||
; dd 0
|
|
||||||
;
|
|
||||||
;aEdit_box_draw db 'edit_box',0
|
;aEdit_box_draw db 'edit_box',0
|
||||||
;aEdit_box_key db 'edit_box_key',0
|
;aEdit_box_key db 'edit_box_key',0
|
||||||
;aEdit_box_mouse db 'edit_box_mouse',0
|
;aEdit_box_mouse db 'edit_box_mouse',0
|
||||||
;aVersion_ed db 'version_ed',0
|
;aVersion_ed db 'version_ed',0
|
||||||
|
|
||||||
;aCheck_box_draw db 'check_box_draw',0
|
|
||||||
;aCheck_box_mouse db 'check_box_mouse',0
|
|
||||||
;aVersion_ch db 'version_ch',0
|
|
||||||
|
|
||||||
;aOption_box_draw db 'option_box_draw',0
|
|
||||||
;aOption_box_mouse db 'option_box_mouse',0
|
|
||||||
;aVersion_op db 'version_op',0
|
|
||||||
|
|
||||||
;---------------------------------------------------------------------
|
|
||||||
macro @use_library
|
macro @use_library
|
||||||
{
|
{
|
||||||
local lp1
|
local lp1
|
||||||
@ -136,13 +118,70 @@ run_notify_struct:
|
|||||||
.Buffer dd 0
|
.Buffer dd 0
|
||||||
db 0
|
db 0
|
||||||
.FileName dd file_name
|
.FileName dd file_name
|
||||||
;---------------------------------------------------------------------
|
|
||||||
|
|
||||||
@library_name equ dword [esp+16]
|
@library_name equ dword [esp+16]
|
||||||
@cur_dir_path equ dword [esp+12]
|
@cur_dir_path equ dword [esp+12]
|
||||||
@library_path equ dword [esp+8]
|
@library_path equ dword [esp+8]
|
||||||
@point_dir_name equ dword [esp+4]
|
@point_dir_name equ dword [esp+4]
|
||||||
|
|
||||||
|
;description:
|
||||||
|
; £®â®¢¨¬ ⥪áâ ¤«ï ¯®ª § ç¥à¥§ @notify:
|
||||||
|
; 1) ¢ë¤¥«ï¥¬ ¯ ¬ïâì ¢ [arrea_xx] ® ¥ ¡®«ìè¥ ®¤®£® à §
|
||||||
|
; 2) ª®¯¨à㥬 § £®«®¢®ª (¥á«¨ ¥áâì ¨¬ï äãªæ¨¨ â® ¤®¡ ¢«ï¥¬ ¥£® ª § £®«®¢ªã) ¨ ⥪áâ á®®¡é¥¨ï ¢ [arrea_xx]
|
||||||
|
;input:
|
||||||
|
; ebp+8 - head message
|
||||||
|
; ebp+12 - error message
|
||||||
|
; ebp+16 - 0 ¨«¨ ¨¬ï äãªæ¨¨, ª®â®àãî ¥ 㤠«®áì íªá¯®àâ¨à®¢ âì
|
||||||
|
;output:
|
||||||
|
; eax = -1
|
||||||
|
align 4
|
||||||
|
l_lib_init_error_window:
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
|
cmp dword[arrea_xx],0
|
||||||
|
jne .no_msg ;¥á«¨ à ìè¥ ¡ë«® ᮧ¤ ® ¤à㣮¥ á®®¡é¥¨¥
|
||||||
|
pushad
|
||||||
|
|
||||||
|
mcall 68,11
|
||||||
|
mcall 68,12,4096
|
||||||
|
mov [arrea_xx],eax
|
||||||
|
|
||||||
|
mov edi,eax
|
||||||
|
mov esi,[ebp+8]
|
||||||
|
align 4
|
||||||
|
@@:
|
||||||
|
movsb
|
||||||
|
cmp byte[esi],0
|
||||||
|
jne @b
|
||||||
|
mov word[edi],0xa0d
|
||||||
|
add edi,2
|
||||||
|
|
||||||
|
;¤®¡ ¢«ï¥¬ ¨¬ï äãªæ¨¨ ¢ § £®«®¢®ª
|
||||||
|
mov esi,[ebp+16]
|
||||||
|
or esi,esi
|
||||||
|
jz .lp1
|
||||||
|
mov word[edi-2],0x2020
|
||||||
|
@@:
|
||||||
|
movsb
|
||||||
|
cmp byte[esi],0
|
||||||
|
jne @b
|
||||||
|
mov word[edi],0xa0d
|
||||||
|
add edi,2
|
||||||
|
.lp1:
|
||||||
|
|
||||||
|
mov esi,[ebp+12]
|
||||||
|
align 4
|
||||||
|
@@:
|
||||||
|
movsb
|
||||||
|
cmp byte[esi],0
|
||||||
|
jne @b
|
||||||
|
mov byte[edi],0
|
||||||
|
popad
|
||||||
|
.no_msg:
|
||||||
|
or eax,-1
|
||||||
|
pop ebp
|
||||||
|
ret 12
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
@copy_path:
|
@copy_path:
|
||||||
mov esi,@cur_dir_path
|
mov esi,@cur_dir_path
|
||||||
@ -200,11 +239,9 @@ align 4
|
|||||||
stosb
|
stosb
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jnz .lp4
|
jnz .lp4
|
||||||
;---------------------------------------------------------------------
|
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
;---------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
macro @use_library_mem mem_alloc,mem_free,mem_realloc,dll_load
|
macro @use_library_mem mem_alloc,mem_free,mem_realloc,dll_load
|
||||||
{
|
{
|
||||||
@ -215,92 +252,93 @@ library_fun_memory_realloc equ mem_realloc
|
|||||||
library_fun_dll_load equ dll_load
|
library_fun_dll_load equ dll_load
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
macro sys_load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__,point_dir_name__
|
macro sys_load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__,point_dir_name__
|
||||||
{
|
{
|
||||||
local end_steep
|
local i_begin
|
||||||
local exit
|
local i_error
|
||||||
;---------------------------------------------------------------------
|
local i_exit
|
||||||
; loading Box_Lib library
|
|
||||||
|
|
||||||
mcall 68,19,system_path__ ; load of sys directory
|
mcall 68,19,system_path__ ; load of sys directory
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jnz end_steep
|
jnz i_begin
|
||||||
|
|
||||||
if point_dir_name__ eq
|
if point_dir_name__ eq
|
||||||
copy_path library_name__, cur_dir_path__, library_path__,0x0
|
copy_path library_name__, cur_dir_path__, library_path__,0
|
||||||
else
|
else
|
||||||
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__ ;the macros making way /current pach a program/+ name system library
|
;the macros making way /current path a program/ + name system library
|
||||||
end if
|
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__
|
||||||
|
end if
|
||||||
mcall 68,19,library_path__ ; load of alternative
|
mcall 68,19,library_path__ ; load of alternative
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jnz end_steep
|
jnz i_begin
|
||||||
show_error_window err_message_found_lib__, head_f_l__ ;show error message /create window
|
push eax
|
||||||
jmp exit
|
push dword err_message_found_lib__
|
||||||
|
push dword head_f_l__
|
||||||
|
jmp i_error
|
||||||
align 4
|
align 4
|
||||||
end_steep:
|
i_begin:
|
||||||
|
import_boxlib myimport
|
||||||
import_boxlib myimport, err_message_import__, head_f_i__ ;import
|
test eax,eax
|
||||||
exit:
|
jz i_exit
|
||||||
test eax,eax
|
push eax
|
||||||
jz @f
|
push dword err_message_import__
|
||||||
|
push dword head_f_i__
|
||||||
notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª® @notify
|
i_error:
|
||||||
or eax,-1
|
call l_lib_init_error_window
|
||||||
@@:
|
notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª® @notify
|
||||||
|
i_exit:
|
||||||
;---------------------------------------------------------------------
|
|
||||||
}
|
}
|
||||||
|
;---------------------------------------------------------------------
|
||||||
|
|
||||||
macro load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__,point_dir_name__
|
macro load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__,point_dir_name__
|
||||||
{
|
{
|
||||||
local end_steep
|
local i_begin
|
||||||
local exit
|
local i_error
|
||||||
;---------------------------------------------------------------------
|
local i_exit
|
||||||
; loading Box_Lib library
|
|
||||||
|
|
||||||
if point_dir_name__ eq
|
if point_dir_name__ eq
|
||||||
copy_path library_name__, cur_dir_path__, library_path__,0x0
|
copy_path library_name__, cur_dir_path__, library_path__,0
|
||||||
else
|
else
|
||||||
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__ ;the macros making way /current pach a program/+ name system library
|
;the macros making way /current path a program/ + name system library
|
||||||
end if
|
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__
|
||||||
|
end if
|
||||||
mcall 68,19,library_path__ ; load of alternative
|
mcall 68,19,library_path__ ; load of alternative
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jnz end_steep
|
jnz i_begin
|
||||||
|
|
||||||
mcall 68,19,system_path__ ; load of sys directory
|
|
||||||
test eax,eax
|
|
||||||
jnz end_steep
|
|
||||||
|
|
||||||
show_error_window err_message_found_lib__, head_f_l__ ;show error message /create window
|
|
||||||
jmp exit
|
|
||||||
|
|
||||||
|
mcall 68,19,system_path__ ; load of sys directory
|
||||||
|
test eax,eax
|
||||||
|
jnz i_begin
|
||||||
|
push eax
|
||||||
|
push dword err_message_found_lib__
|
||||||
|
push dword head_f_l__
|
||||||
|
jmp i_error
|
||||||
align 4
|
align 4
|
||||||
end_steep:
|
i_begin:
|
||||||
|
import_boxlib myimport
|
||||||
import_boxlib myimport, err_message_import__, head_f_i__ ;import
|
test eax,eax
|
||||||
exit:
|
jz i_exit
|
||||||
test eax,eax
|
push eax
|
||||||
jz @f
|
push dword err_message_found_lib__
|
||||||
|
push dword head_f_l__
|
||||||
notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª® @notify
|
i_error:
|
||||||
or eax,-1
|
call l_lib_init_error_window
|
||||||
@@:
|
notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª® @notify
|
||||||
|
i_exit:
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
|
;description:
|
||||||
|
; ¬ ªà®á § £à㧪¨ ¡¨¡«¨®â¥ª ¨§ á¨á⥬®© ¯ ¯ª¨, ¥á«¨ ¡¨¡«¨®â¥ª ¥ ©¤¥
|
||||||
|
; ⮣¤ ¯®¨áª ¨¤¥â ¢ ⥪ã饩 ¯ ¯ª¥ á ¯à®£à ¬¬®©
|
||||||
macro sys_load_libraries _start,_end
|
macro sys_load_libraries _start,_end
|
||||||
{
|
{
|
||||||
local exit_lp2
|
local cycle0
|
||||||
local lp2
|
|
||||||
local lp
|
|
||||||
local end_steep
|
local end_steep
|
||||||
local next
|
local cycle0n
|
||||||
|
local cycle1
|
||||||
|
local cycle1n
|
||||||
|
local cycle1e
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
library_name__ equ [ebp]
|
library_name__ equ [ebp]
|
||||||
cur_dir_path__ equ [ebp+4]
|
cur_dir_path__ equ [ebp+4]
|
||||||
@ -315,70 +353,76 @@ point_dir_name__ equ [ebp+36]
|
|||||||
adr_load_lib equ dword [ebp+40]
|
adr_load_lib equ dword [ebp+40]
|
||||||
status_lib equ dword [ebp+44]
|
status_lib equ dword [ebp+44]
|
||||||
|
|
||||||
mov ebp,_start
|
mov ebp,_start
|
||||||
mov ecx,((_end-_start)/ll_struc_size)
|
mov ecx,(_end-_start)/ll_struc_size
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
lp: push ecx
|
cycle0:
|
||||||
|
push ecx
|
||||||
mcall 68,19,system_path__ ; load of sys directory
|
mcall 68,19,system_path__ ; load of sys directory
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jnz end_steep
|
jnz end_steep
|
||||||
|
|
||||||
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__ ;the macros making way /current pach a program/+ name system library
|
;the macros making way /current path a program/ + name system library
|
||||||
|
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__
|
||||||
|
|
||||||
mcall 68,19,library_path__ ; load of alternative
|
mcall 68,19,library_path__ ; load of alternative
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jnz end_steep
|
jnz end_steep
|
||||||
|
or status_lib,1 ; status of code - enable error - not found library
|
||||||
|
|
||||||
or status_lib,0x1 ; status of code - enable error - not found library
|
push eax
|
||||||
|
push dword err_message_found_lib__
|
||||||
show_error_window err_message_found_lib__, head_f_l__, ;show error message /create window
|
push dword head_f_l__
|
||||||
jmp next
|
call l_lib_init_error_window
|
||||||
|
jmp cycle0n
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
end_steep:
|
end_steep:
|
||||||
mov adr_load_lib,eax ;save adr lib in memory
|
mov adr_load_lib,eax ;save adr lib in memory
|
||||||
import_boxlib my_import, err_message_import__, head_f_i__ ;import
|
import_boxlib my_import
|
||||||
|
test eax,eax
|
||||||
test eax,eax
|
jz cycle0n
|
||||||
jz next
|
or status_lib,2 ; status of code - enable error - import error
|
||||||
|
push eax
|
||||||
or status_lib,0x2 ; status of code - enable error - import error
|
push dword err_message_import__
|
||||||
|
push dword head_f_i__
|
||||||
next:
|
call l_lib_init_error_window
|
||||||
pop ecx
|
cycle0n:
|
||||||
add ebp,ll_struc_size
|
pop ecx
|
||||||
dec ecx
|
add ebp,ll_struc_size
|
||||||
jnz lp
|
dec ecx
|
||||||
|
jnz cycle0
|
||||||
;----------------------------------
|
|
||||||
mov ebp,_start
|
|
||||||
mov ecx,((_end-_start)/ll_struc_size)
|
|
||||||
|
|
||||||
|
;¢ë¢®¤ á®®¡é¥¨ï ®¡ ®è¨¡ª¥ ¯à¨ § £à㧪¥
|
||||||
|
mov ebp,_start
|
||||||
|
mov ecx,(_end-_start)/ll_struc_size
|
||||||
align 4
|
align 4
|
||||||
lp2:
|
cycle1:
|
||||||
mov eax,status_lib
|
mov eax,status_lib
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jz @f
|
jz cycle1n
|
||||||
|
notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª® @notify
|
||||||
notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª® @notify
|
mov eax,-1
|
||||||
or eax,-1
|
jmp cycle1e
|
||||||
jmp exit_lp2
|
align 4
|
||||||
|
cycle1n:
|
||||||
@@:
|
add ebp,ll_struc_size
|
||||||
add ebp,ll_struc_size
|
dec ecx
|
||||||
dec ecx
|
jnz cycle1
|
||||||
jnz lp2
|
cycle1e:
|
||||||
exit_lp2:
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
;description:
|
||||||
|
; ¬ ªà®á § £à㧪¨ ¡¨¡«¨®â¥ª ¨§ ⥪ã饩 ¯ ¯ª¨ á ¯à®£à ¬¬®©, ¥á«¨ ¡¨¡«¨®â¥ª ¥ ©¤¥
|
||||||
|
; ⮣¤ ¯®¨áª ¨¤¥â ¢ á¨á⥬®© ¯ ¯ª¥
|
||||||
macro load_libraries _start,_end
|
macro load_libraries _start,_end
|
||||||
{
|
{
|
||||||
local lp2
|
local cycle0
|
||||||
local exit_lp2
|
|
||||||
local lp
|
|
||||||
local end_steep
|
local end_steep
|
||||||
local next
|
local cycle0n
|
||||||
|
local cycle1
|
||||||
|
local cycle1n
|
||||||
|
local cycle1e
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
library_name__ equ [ebp]
|
library_name__ equ [ebp]
|
||||||
cur_dir_path__ equ [ebp+4]
|
cur_dir_path__ equ [ebp+4]
|
||||||
@ -393,64 +437,64 @@ point_dir_name__ equ [ebp+36]
|
|||||||
adr_load_lib equ dword [ebp+40]
|
adr_load_lib equ dword [ebp+40]
|
||||||
status_lib equ dword [ebp+44]
|
status_lib equ dword [ebp+44]
|
||||||
|
|
||||||
mov ebp,_start
|
mov ebp,_start
|
||||||
mov ecx,((_end-_start)/ll_struc_size)
|
mov ecx,(_end-_start)/ll_struc_size
|
||||||
|
align 4
|
||||||
|
cycle0:
|
||||||
|
push ecx
|
||||||
|
|
||||||
|
;the macros making way /current path a program/ + name system library
|
||||||
|
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__
|
||||||
|
|
||||||
|
mcall 68,19,library_path__ ; load of alternative
|
||||||
|
test eax,eax
|
||||||
|
jnz end_steep
|
||||||
|
|
||||||
|
mcall 68,19,system_path__ ; load of sys directory
|
||||||
|
test eax,eax
|
||||||
|
jnz end_steep
|
||||||
|
or status_lib,1 ; status of code - enable error - not found library
|
||||||
|
|
||||||
|
push eax
|
||||||
|
push dword err_message_found_lib__
|
||||||
|
push dword head_f_l__
|
||||||
|
call l_lib_init_error_window
|
||||||
|
jmp cycle0n
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
lp: push ecx
|
end_steep:
|
||||||
|
mov adr_load_lib,eax ;save adr lib in memory
|
||||||
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__ ;the macros making way /current pach a program/+ name system library
|
import_boxlib my_import
|
||||||
|
test eax,eax
|
||||||
mcall 68,19,library_path__ ; load of alternative
|
jz cycle0n
|
||||||
test eax,eax
|
or status_lib,2 ; status of code - enable error - import error
|
||||||
jnz end_steep
|
push eax
|
||||||
|
push dword err_message_import__
|
||||||
mcall 68,19,system_path__ ; load of sys directory
|
push dword head_f_i__
|
||||||
test eax,eax
|
call l_lib_init_error_window
|
||||||
jnz end_steep
|
cycle0n:
|
||||||
|
pop ecx
|
||||||
or status_lib,0x1 ; status of code - enable error - not found library
|
add ebp,ll_struc_size
|
||||||
|
dec ecx
|
||||||
show_error_window err_message_found_lib__, head_f_l__ ;show error message /create window
|
jnz cycle0
|
||||||
jmp next
|
|
||||||
|
|
||||||
|
;¢ë¢®¤ á®®¡é¥¨ï ®¡ ®è¨¡ª¥ ¯à¨ § £à㧪¥
|
||||||
|
mov ebp,_start
|
||||||
|
mov ecx,(_end-_start)/ll_struc_size
|
||||||
align 4
|
align 4
|
||||||
end_steep:
|
cycle1:
|
||||||
mov adr_load_lib,eax ;save adr lib in memory
|
mov eax,status_lib
|
||||||
|
test eax,eax
|
||||||
import_boxlib my_import, err_message_import__, head_f_i__ ;import
|
jz cycle1n
|
||||||
|
notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª® @notify
|
||||||
test eax,eax
|
mov eax,-1
|
||||||
jz next
|
jmp cycle1e
|
||||||
|
|
||||||
or status_lib,0x2 ; status of code - enable error - import error
|
|
||||||
|
|
||||||
next:
|
|
||||||
pop ecx
|
|
||||||
add ebp,ll_struc_size
|
|
||||||
dec ecx
|
|
||||||
jnz lp
|
|
||||||
|
|
||||||
;-----------------------------------------------
|
|
||||||
mov ebp,_start
|
|
||||||
mov ecx,((_end-_start)/ll_struc_size)
|
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
lp2:
|
cycle1n:
|
||||||
mov eax,status_lib
|
add ebp,ll_struc_size
|
||||||
test eax,eax
|
dec ecx
|
||||||
jz @f
|
jnz cycle1
|
||||||
|
cycle1e:
|
||||||
notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª® @notify
|
|
||||||
or eax,-1
|
|
||||||
jmp exit_lp2
|
|
||||||
|
|
||||||
@@:
|
|
||||||
add ebp,ll_struc_size
|
|
||||||
dec ecx
|
|
||||||
jnz lp2
|
|
||||||
exit_lp2:
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -468,41 +512,6 @@ pushad ;save all registers
|
|||||||
popad ;restore all registers
|
popad ;restore all registers
|
||||||
}
|
}
|
||||||
|
|
||||||
; £®â®¢¨¬ ⥪áâ ¤«ï ¯®ª § ç¥à¥§ @notify:
|
|
||||||
; 1) ¢ë¤¥«ï¥¬ ¯ ¬ïâì ¢ [arrea_xx]
|
|
||||||
; 2) ª®¯¨à㥬 err_message ¨ head ¢ [arrea_xx]
|
|
||||||
macro show_error_window err_message, head
|
|
||||||
{
|
|
||||||
local lp0
|
|
||||||
local lp1
|
|
||||||
|
|
||||||
pushad
|
|
||||||
mcall 68,11
|
|
||||||
mcall 68,12,4096
|
|
||||||
push eax
|
|
||||||
pop dword[arrea_xx]
|
|
||||||
|
|
||||||
mov edi,eax
|
|
||||||
mov esi,head
|
|
||||||
cld
|
|
||||||
align 4
|
|
||||||
lp0:
|
|
||||||
movsb
|
|
||||||
cmp byte[esi],0
|
|
||||||
jne lp0
|
|
||||||
mov word[edi],0xa0d
|
|
||||||
add edi,2
|
|
||||||
mov esi,dword err_message
|
|
||||||
align 4
|
|
||||||
lp1:
|
|
||||||
movsb
|
|
||||||
cmp byte[esi],0
|
|
||||||
jne lp1
|
|
||||||
mov byte[edi],0
|
|
||||||
popad
|
|
||||||
or eax,-1 ;ã¢ë
|
|
||||||
}
|
|
||||||
|
|
||||||
; ¢ª«îç ¥¬ ¯®ª § á®®¡é¥¨ï ç¥à¥§ @notify:
|
; ¢ª«îç ¥¬ ¯®ª § á®®¡é¥¨ï ç¥à¥§ @notify:
|
||||||
macro notify_window_run message
|
macro notify_window_run message
|
||||||
{
|
{
|
||||||
@ -516,10 +525,12 @@ pop ebx eax
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
;¢å®¤ë¥ ¯ à ¬¥âàë:
|
;input:
|
||||||
;eax - ¤à¥á ¡¨¡«¨®â¥ª¨ ¢ ¯ ¬ïâ¨
|
; eax - ¤à¥á ¡¨¡«¨®â¥ª¨ ¢ ¯ ¬ïâ¨
|
||||||
;myimport - ¨¬¯®àâ¨àã¥¬ë¥ äãªæ¨¨
|
; myimport - ¨¬¯®àâ¨àã¥¬ë¥ äãªæ¨¨
|
||||||
macro import_boxlib myimport, err_message_import__, head_f_i__
|
;output:
|
||||||
|
; eax - ¥á«¨ ã¤ ç® â® 0 ¨«¨ 㪠§ â¥«ì ¨¬ï äãªæ¨¨ ª®â®àãî ¥ 㤠«®áì § £à㧨âì
|
||||||
|
macro import_boxlib myimport
|
||||||
{
|
{
|
||||||
local import_loop
|
local import_loop
|
||||||
local import_find
|
local import_find
|
||||||
@ -528,7 +539,6 @@ local import_find_next
|
|||||||
local import_found
|
local import_found
|
||||||
local import_done
|
local import_done
|
||||||
local exit
|
local exit
|
||||||
local e.exit
|
|
||||||
local import_not_found
|
local import_not_found
|
||||||
; initialize import
|
; initialize import
|
||||||
|
|
||||||
@ -540,13 +550,13 @@ import_loop:
|
|||||||
jz import_done ;¥á«¨ 㪠§ â¥«ì ¨¬ï äãªæ¨¨ = 0 (¢ ¯®«ì§®¢ ⥫ì᪮© ¯à®£à ¬¬¥)
|
jz import_done ;¥á«¨ 㪠§ â¥«ì ¨¬ï äãªæ¨¨ = 0 (¢ ¯®«ì§®¢ ⥫ì᪮© ¯à®£à ¬¬¥)
|
||||||
push edx ;á®åà 塞 ç «® ¡¨¡«¨®â¥çëå 㪠§ ⥫¥© äãªæ¨¨
|
push edx ;á®åà 塞 ç «® ¡¨¡«¨®â¥çëå 㪠§ ⥫¥© äãªæ¨¨
|
||||||
import_find:
|
import_find:
|
||||||
mov ebx, [ds:edx]
|
mov ebx, [edx]
|
||||||
test ebx, ebx
|
test ebx, ebx
|
||||||
jz import_not_found ;¥á«¨ 㪠§ â¥«ì ¨¬ï äãªæ¨¨ = 0 (¢ ¡¨¡«¨®â¥ª¥)
|
jz import_not_found ;¥á«¨ 㪠§ â¥«ì ¨¬ï äãªæ¨¨ = 0 (¢ ¡¨¡«¨®â¥ª¥)
|
||||||
push eax ;eax - 㪠§ â¥«ì ¨¬ï íªá¯®àâ¨à㥬®© äãªæ¨¨ (¢ ¯®«ì§®¢ ⥫ì᪮© ¯à®£à ¬¬¥)
|
push eax ;eax - 㪠§ â¥«ì ¨¬ï íªá¯®àâ¨à㥬®© äãªæ¨¨ (¢ ¯®«ì§®¢ ⥫ì᪮© ¯à®£à ¬¬¥)
|
||||||
lp:
|
lp:
|
||||||
mov cl, [ds:eax]
|
mov cl, [eax]
|
||||||
cmp cl, [ds:ebx] ;áà ¢¨¢ ¥¬ ¨¬¥ äãªæ¨© ¢ ¡¨¡«¨®â¥ª¥ ¨ ¢ ¯®«ì§®¢ ⥫ì᪮© ¯à®£à ¬¬¥
|
cmp cl, [ebx] ;áà ¢¨¢ ¥¬ ¨¬¥ äãªæ¨© ¢ ¡¨¡«¨®â¥ª¥ ¨ ¢ ¯®«ì§®¢ ⥫ì᪮© ¯à®£à ¬¬¥
|
||||||
jnz import_find_next ;¥á«¨ §¢ ¨ï ¥ ᮢ¯ «¨
|
jnz import_find_next ;¥á«¨ §¢ ¨ï ¥ ᮢ¯ «¨
|
||||||
test cl, cl
|
test cl, cl
|
||||||
jz import_found ;¥á«¨ §¢ ¨ï ᮢ¯ «¨, ¨ 㦥 ª®¥æ áâப¨ (cl=0)
|
jz import_found ;¥á«¨ §¢ ¨ï ᮢ¯ «¨, ¨ 㦥 ª®¥æ áâப¨ (cl=0)
|
||||||
@ -559,7 +569,7 @@ import_find_next:
|
|||||||
jmp import_find
|
jmp import_find
|
||||||
import_found:
|
import_found:
|
||||||
pop ebx ;¢®áâ ¢«¨¢ ¥¬ 㪠§ â¥«ì ¨¬ï äãªæ¨¨ (ª®â®àë© ¡ë« ¢ eax) ¨ ®á¢®¡®¦¤ ¥¬ á⥪
|
pop ebx ;¢®áâ ¢«¨¢ ¥¬ 㪠§ â¥«ì ¨¬ï äãªæ¨¨ (ª®â®àë© ¡ë« ¢ eax) ¨ ®á¢®¡®¦¤ ¥¬ á⥪
|
||||||
mov eax, [ds:edx+4] ;eax = 㪠§ ⥫ì äãªæ¨î (¢ ¡¨¡«¨®â¥ª¥)
|
mov eax, [edx+4] ;eax = 㪠§ ⥫ì äãªæ¨î (¢ ¡¨¡«¨®â¥ª¥)
|
||||||
mov [esi-4], eax ;ª®¯¨à㥬 㪠§ ⥫ì ( äãªæ¨î) ¢ ¯à®£à ¬¬ã, -4 áâ ¢¨¬ ¯®â®¬ã çâ® esi ¡ë«® ᤢ¨ãâ® ª®¬ ¤®© lodsd
|
mov [esi-4], eax ;ª®¯¨à㥬 㪠§ ⥫ì ( äãªæ¨î) ¢ ¯à®£à ¬¬ã, -4 áâ ¢¨¬ ¯®â®¬ã çâ® esi ¡ë«® ᤢ¨ãâ® ª®¬ ¤®© lodsd
|
||||||
pop edx ;ãáâ ¢«¨¢ ¥¬ edx ç «® ¡¨¡«¨®â¥çëå äãªæ¨©
|
pop edx ;ãáâ ¢«¨¢ ¥¬ edx ç «® ¡¨¡«¨®â¥çëå äãªæ¨©
|
||||||
;--- ¯à®¢¥à塞 ᮢ¯ ¤ ¥â «¨ ¨¬ï íªá¯®àâ¨à®¢ ®© äãªæ¨¨ á 'lib_init'
|
;--- ¯à®¢¥à塞 ᮢ¯ ¤ ¥â «¨ ¨¬ï íªá¯®àâ¨à®¢ ®© äãªæ¨¨ á 'lib_init'
|
||||||
@ -585,13 +595,13 @@ end if
|
|||||||
jmp import_loop
|
jmp import_loop
|
||||||
import_not_found:
|
import_not_found:
|
||||||
add esp,4
|
add esp,4
|
||||||
show_error_window err_message_import__, head_f_i__ ;show error message /create window
|
jmp exit
|
||||||
jmp e.exit
|
|
||||||
import_done:
|
import_done:
|
||||||
xor eax,eax ;=0 ¢á¥ § £à㧨«®áì 㤠ç®
|
xor eax,eax ;=0 ¢á¥ § £à㧨«®áì 㤠ç®
|
||||||
e.exit:
|
exit:
|
||||||
|
}
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
}
|
|
||||||
ll_struc_size = 48;($-library_name__) ; constant size of struct
|
ll_struc_size = 48;($-library_name__) ; constant size of struct
|
||||||
struc l_libs library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, my_import, err_message_import__, head_f_i__,point_dir_name; struct for loading libraries
|
struc l_libs library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, my_import, err_message_import__, head_f_i__,point_dir_name; struct for loading libraries
|
||||||
{
|
{
|
||||||
@ -607,11 +617,11 @@ struc l_libs library_name__, cur_dir_path__, library_path__, system_path__, err_
|
|||||||
.err_message_import__ dd err_message_import__
|
.err_message_import__ dd err_message_import__
|
||||||
.head_f_i__ dd head_f_i__
|
.head_f_i__ dd head_f_i__
|
||||||
if point_dir_name eq
|
if point_dir_name eq
|
||||||
.point_dir_name__ dd 0x0
|
.point_dir_name__ dd 0
|
||||||
else
|
else
|
||||||
.point_dir_name__ dd point_dir_name ; ¨¬ï ¢«®¦¥®© ¤¨à४â®à¨¨ ¢ ªâ®à®© åà ïâìáï ¯®¤£à㦠¥¬ë¥ ¬®¤ã«¨.
|
.point_dir_name__ dd point_dir_name ; ¨¬ï ¢«®¦¥®© ¤¨à४â®à¨¨ ¢ ªâ®à®© åà ïâìáï ¯®¤£à㦠¥¬ë¥ ¬®¤ã«¨.
|
||||||
end if
|
end if
|
||||||
.adr_load_lib dd 0x0
|
.adr_load_lib dd 0
|
||||||
.status_lib dd 0x0 ;status of load library
|
.status_lib dd 0 ;status of load library
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user