new voxel utilite 'vox_tgl'

git-svn-id: svn://kolibrios.org@5388 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2015-01-29 11:59:15 +00:00
parent 23f3365f2a
commit 4cce570333
7 changed files with 2784 additions and 333 deletions

View File

@ -0,0 +1,177 @@
;
; ” ©« ¤«ï à ¡®âë á® áâப®¢ë¬¨ äã­ªæ¨ï¬¨
;
; str_len (str1)
; „«¨­  áâப¨ (¢®§¢à é ¥âáï ¢ eax)
; str_cat (str1, str2)
; „®¡ ¢«¥­¨¥ ª áâப¥ st1 áâப¨ str2
; str_n_cat (str1, str2, n_len)
; „®¡ ¢«¥­¨¥ ª áâப¥ st1 áâப¨ str2. …᫨ áâப  str2 ¤«¨­­¥¥ 祬 n_len, â® ¤®¡ ¢«ïîâáï ¯¥à¢ë¥ n_len ᨬ¢®«®¢.
; conv_str_to_int (buf)
; <EFBFBD>८¡à §®¢ ­¨¥ áâப¨ buf ¢ ç¨á«® (¢®§¢à é ¥âáï ¢ eax)
; convert_int_to_str (len)
; <EFBFBD>८¡à §®¢ ­¨¥ ç¨á«  (eax) ¢ áâபã (edi). len - ¤«¨­­  áâப¨ edi, ª®â®àãî ¬®¦­® ¨á¯®«ì§®¢ âì ¤«ï ¯à¥®¡à §®¢ ­¨ï.
;output:
; eax = strlen
align 4
proc str_len, str1:dword
mov eax,[str1]
@@:
cmp byte[eax],0
je @f
inc eax
jmp @b
@@:
sub eax,[str1]
ret
endp
align 4
proc str_cat uses eax ecx edi esi, str1:dword, str2:dword
mov esi,[str2]
stdcall str_len,esi
mov ecx,eax
inc ecx
mov edi,[str1]
stdcall str_len,edi
add edi,eax
cld
repne movsb
ret
endp
align 4
proc str_n_cat uses eax ecx edi esi, str1:dword, str2:dword, n_len:dword
mov esi,[str2]
mov ecx,[n_len]
mov edi,[str1]
stdcall str_len,edi
add edi,eax
cld
repne movsb
mov byte[edi],0
ret
endp
;input:
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
;output:
; eax - ç¨á«®
align 4
proc conv_str_to_int uses ebx ecx esi, buf:dword
xor eax,eax
xor ebx,ebx
mov esi,[buf]
;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
xor ecx,ecx
inc ecx
cmp byte[esi],'-'
jne @f
dec ecx
inc esi
@@:
cmp word[esi],'0x'
je .load_digit_16
.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'9'
jg @f
sub bl,'0'
imul eax,10
add eax,ebx
inc esi
jmp .load_digit_10
jmp @f
.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
add esi,2
.cycle_16:
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'f'
jg @f
cmp bl,'9'
jle .us1
cmp bl,'A'
jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
cmp bl,'F'
jle .us2
cmp bl,'a'
jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
sub bl,'0'
cmp bl,9
jle .cor1
sub bl,7 ;convert 'A' to '10'
.cor1:
shl eax,4
add eax,ebx
inc esi
jmp .cycle_16
@@:
or ecx,ecx ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
jnz @f
neg eax
inc eax
@@:
ret
endp
;input:
; eax - ç¨á«®
; edi - ¡ãä¥à ¤«ï áâப¨
; len - ¤«¨­­  ¡ãä¥à 
;output:
align 4
proc convert_int_to_str, len:dword
pushad
mov esi,[len]
add esi,edi
dec esi
bt eax,31
jae @f
;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
neg eax
;inc eax ;???
mov byte[edi],'-'
inc edi
@@:
call .str
popad
ret
endp
align 4
.str:
mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®©
cmp eax,ecx ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
jb @f
xor edx,edx ;®ç¨áâ¨âì edx
div ecx ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
push edx ;¯®«®¦¨âì ¢ á⥪
;dec edi ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
pop eax
@@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
cmp edi,esi
jge @f
or al,0x30 ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥ 祬 ¤¢¥ ¢ëè¥
stosb ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
mov byte[edi],0 ;¢ ª®­¥æ áâப¨ áâ ¢¨¬ 0, çâ®-¡ë ­¥ ¢ë« §¨« ¬ãá®à
@@:
ret ;¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï

View File

@ -1,10 +1,13 @@
if not exist bin mkdir bin
if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png
if not exist bin\toolbar_m.png @copy toolbar_m.png bin\toolbar_m.png
if not exist bin\buf2d.obj @fasm.exe -m 16384 ..\..\..\develop\libraries\buf2d\trunk\buf2d.asm bin\buf2d.obj
@kpack bin\buf2d.obj
if not exist bin\toolbar_t.png @copy toolbar_t.png bin\toolbar_t.png
if not exist bin\buf2d.obj @fasm.exe -m 16384 ..\..\..\develop\libraries\TinyGL\asm_fork\tinygl.asm bin\tinygl.obj
@kpack bin\tinygl.obj
@fasm.exe -m 16384 vox_creator.asm bin\vox_creator.kex
@kpack bin\vox_creator.kex
@fasm.exe -m 16384 vox_mover.asm bin\vox_mover.kex
@kpack bin\vox_mover.kex
@fasm.exe -m 16384 vox_tgl.asm bin\vox_tgl.kex
@kpack bin\vox_tgl.kex
pause

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@ include '../../../../programs/macros.inc'
include '../../../../programs/proc32.inc'
include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
include '../../../../programs/dll.inc'
include '../trunk/str.inc'
vox_offs_tree_table equ 4
vox_offs_data equ 12
@ -20,7 +21,7 @@ txt_buf rb 8
include '../trunk/vox_rotate.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
caption db 'Voxel creator 03.10.13',0 ;¯®¤¯¨áì ®ª­ 
caption db 'Voxel creator 29.01.15',0 ;¯®¤¯¨áì ®ª­ 
struct FileInfoBlock
Function dd ?
@ -397,20 +398,13 @@ pushad
; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
xor eax,eax
mov ebx,(20 shl 16)+410
mov ecx,(20 shl 16)+520
mov edx,[sc.work]
or edx,(3 shl 24)+0x30000000
mov edi,caption
int 0x40
mcall ,(20 shl 16)+410,(20 shl 16)+520,,,caption
; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
mov eax,8
mov ebx,(5 shl 16)+20
mov ecx,(5 shl 16)+20
mov edx,3
mov esi,[sc.work_button]
int 0x40
mcall 8,(5 shl 16)+20,(5 shl 16)+20,3
mov ebx,(30 shl 16)+20
mov edx,4
@ -449,11 +443,8 @@ pushad
int 0x40
; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
mov eax,7
mov ebx,[image_data_toolbar]
mov ecx,(16 shl 16)+16
mov edx,(7 shl 16)+7 ;icon new
int 0x40
mcall 7,[image_data_toolbar],(16 shl 16)+16
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16) ;icon open
@ -504,8 +495,6 @@ align 4
draw_pok:
;®¡­®¢«¥­¨¥ ¯®¤¯¨á¨ à §¬¥à  ä ©« 
mov edi,txt_f_size.size
mov dword[edi],0
mov dword[edi+4],0
mov eax,dword[vox_obj_size]
mov ebx,txt_pref
.cycle:
@ -516,17 +505,15 @@ draw_pok:
jmp .cycle
@@:
call convert_int_to_str
stdcall convert_int_to_str, 16
stdcall str_cat, edi,ebx
stdcall str_cat, edi,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
mov ebx,(275 shl 16)+7
;à¨á®¢ ­¨¥ ⥪áâ 
mov ecx,[sc.work_text]
or ecx,0x80000000 or (1 shl 30)
mov edx,txt_f_size
mov edi,[sc.work] ;梥â ä®­  ®ª­ 
int 0x40
mcall 4,(275 shl 16)+7,,txt_f_size
ret
@ -1237,108 +1224,6 @@ proc open_image_in_buf, buf:dword
ret
endp
;input:
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
;output:
; eax - ç¨á«®
align 4
proc conv_str_to_int, buf:dword
xor eax,eax
push ebx ecx esi
xor ebx,ebx
mov esi,[buf]
;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
xor ecx,ecx
inc ecx
cmp byte[esi],'-'
jne @f
dec ecx
inc esi
@@:
cmp word[esi],'0x'
je .load_digit_16
.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'9'
jg @f
sub bl,'0'
imul eax,10
add eax,ebx
inc esi
jmp .load_digit_10
jmp @f
.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
add esi,2
.cycle_16:
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'f'
jg @f
cmp bl,'9'
jle .us1
cmp bl,'A'
jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
cmp bl,'F'
jle .us2
cmp bl,'a'
jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
sub bl,'0'
cmp bl,9
jle .cor1
sub bl,7 ;convert 'A' to '10'
.cor1:
shl eax,4
add eax,ebx
inc esi
jmp .cycle_16
@@:
cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
jne @f
sub ecx,eax
mov eax,ecx
@@:
pop esi ecx ebx
ret
endp
align 4
proc str_cat uses eax ecx edi esi, str1:dword, str2:dword
mov esi,dword[str2]
stdcall str_len,esi
mov ecx,eax
inc ecx
mov edi,dword[str1]
stdcall str_len,edi
add edi,eax
cld
repne movsb
ret
endp
;output:
; eax = strlen
align 4
proc str_len, str1:dword
mov eax,[str1]
@@:
cmp byte[eax],0
je @f
inc eax
jmp @b
@@:
sub eax,[str1]
ret
endp
msgbox_0:
db 1,0
db '‚­¨¬ ­¨¥',0
@ -1691,38 +1576,7 @@ buf_vox:
rb BUF_STRUCT_SIZE*(2+1)
;input:
; eax = value
; edi = string buffer
;output:
align 4
convert_int_to_str:
pushad
cld
mov dword[edi+1],0
mov word[edi+5],0
call .str
popad
ret
align 4
.str:
mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®©
cmp eax,ecx ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
jb @f
xor edx,edx ;®ç¨áâ¨âì edx
div ecx ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
push edx ;¯®«®¦¨âì ¢ á⥪
;dec edi ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
pop eax
@@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
or al,0x30 ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥ 祬 ¤¢¥ ¢ëè¥
stosb ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
ret ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
align 16
i_end:
rb 2048
thread:

View File

@ -15,9 +15,10 @@ include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
include '../../../../programs/dll.inc'
include '../trunk/vox_draw.inc'
include '../trunk/vox_rotate.inc'
include '../trunk/str.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
caption db 'Voxel mover 13.09.12',0 ;¯®¤¯¨áì ®ª­ 
caption db 'Voxel mover 29.01.15',0 ;¯®¤¯¨áì ®ª­ 
struct FileInfoBlock
Function dd ?
@ -32,7 +33,6 @@ ends
run_file_70 FileInfoBlock
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
fn_toolbar db 'toolbar_m.png',0
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*18
image_data_toolbar dd 0
@ -174,7 +174,7 @@ start:
stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
load_image_file 'toolbar_m.png', image_data_toolbar,IMAGE_TOOLBAR_SIZE
stdcall mem.Alloc,[max_open_file_size]
mov dword[open_file_vox],eax
@ -352,16 +352,11 @@ pushad
; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
mov edx,[sc.work]
or edx,(3 shl 24)+0x30000000
mov edi,caption
mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4]
mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4],,,caption
; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
mov eax,8
mov ebx,(5 shl 16)+20
mov ecx,(5 shl 16)+20
mov edx,3
mov esi,[sc.work_button]
int 0x40
mcall 8,(5 shl 16)+20,(5 shl 16)+20,3
mov ebx,(30 shl 16)+20
mov edx,4
@ -416,11 +411,8 @@ pushad
int 0x40
; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
mov eax,7
mov ebx,[image_data_toolbar]
mov ecx,(16 shl 16)+16
mov edx,(7 shl 16)+7 ;icon new
int 0x40
mcall 7,[image_data_toolbar],(16 shl 16)+16
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16) ;icon open
@ -485,14 +477,10 @@ popad
align 4
draw_pok:
mov eax,47
mov ecx,[v_zoom]
mov ebx,(3 shl 16)+(1 shl 31)
mov edx,((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2
mov esi,[sc.work_button_text]
or esi,(1 shl 30)
mov edi,[sc.work_button]
int 0x40 ;¬ áèâ ¡
mcall 47, (3 shl 16)+(1 shl 31), [v_zoom], ((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2 ;¬ áèâ ¡
mov ecx,[n_plane]
add edx,115 shl 16 ;9
int 0x40 ;­®¬¥à á¥ç¥­¨ï
@ -501,11 +489,11 @@ draw_pok:
mov dword[txt_curor.size],0
mov eax,dword[v_cur_x]
mov edi,txt_curor.size
call convert_int_to_str
stdcall convert_int_to_str,10
stdcall str_cat, edi,txt_mull
mov eax,dword[v_cur_y]
mov edi,txt_buf
call convert_int_to_str
stdcall convert_int_to_str,16
stdcall str_cat, txt_curor.size,edi
stdcall str_cat, txt_curor.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
@ -513,25 +501,23 @@ draw_pok:
mov dword[txt_mov_offs.size],0
mov eax,dword[mov_x]
mov edi,txt_mov_offs.size
call convert_int_to_str
stdcall convert_int_to_str,30
stdcall str_cat, edi,txt_space
mov eax,dword[mov_y]
mov edi,txt_buf
call convert_int_to_str
stdcall convert_int_to_str,16
stdcall str_cat, txt_mov_offs.size,edi
stdcall str_cat, txt_mov_offs.size,txt_space
mov eax,dword[mov_z]
mov edi,txt_buf
call convert_int_to_str
stdcall convert_int_to_str,16
stdcall str_cat, txt_mov_offs.size,edi
stdcall str_cat, txt_mov_offs.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
mov ebx,(OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2
;à¨á®¢ ­¨¥ ⥪áâ 
mov ecx,[sc.work_text]
or ecx,0x80000000 ;or (1 shl 30)
mov edx,txt_color
int 0x40
mcall 4, (OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2,,txt_color
mov edx,txt_curor
add ebx,115 shl 16
@ -559,16 +545,14 @@ on_change_color:
pushad
mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;¯® ®á¨ x
mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;¯® ®á¨ y
mov edx,[v_color]
mcall 13
mcall 13,,,[v_color]
mov ebx,(1 shl 8)+(6 shl 16)
mov ecx,edx
mov edx,((OT_CAPT_X_COLOR+55) shl 16)+OT_CAPT_Y_COLOR+2
mov esi,[sc.work_text]
add esi,(1 shl 30)
mov edi,[sc.work]
mcall 47
mcall 47,(1 shl 8)+(6 shl 16)
popad
ret
@ -1319,150 +1303,6 @@ pushad
popad
ret
if 0
;input:
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
;output:
; eax - ç¨á«®
align 4
proc conv_str_to_int, buf:dword
xor eax,eax
push ebx ecx esi
xor ebx,ebx
mov esi,[buf]
;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
xor ecx,ecx
inc ecx
cmp byte[esi],'-'
jne @f
dec ecx
inc esi
@@:
cmp word[esi],'0x'
je .load_digit_16
.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'9'
jg @f
sub bl,'0'
imul eax,10
add eax,ebx
inc esi
jmp .load_digit_10
jmp @f
.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
add esi,2
.cycle_16:
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'f'
jg @f
cmp bl,'9'
jle .us1
cmp bl,'A'
jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
cmp bl,'F'
jle .us2
cmp bl,'a'
jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
sub bl,'0'
cmp bl,9
jle .cor1
sub bl,7 ;convert 'A' to '10'
.cor1:
shl eax,4
add eax,ebx
inc esi
jmp .cycle_16
@@:
cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
jne @f
sub ecx,eax
mov eax,ecx
@@:
pop esi ecx ebx
ret
endp
end if
;input:
; eax = value
; edi = string buffer
;output:
align 4
convert_int_to_str:
pushad
bt eax,31
jae @f
;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
neg eax
;inc eax
;clc
mov byte[edi],'-'
inc edi
@@:
mov dword[edi+1],0
mov word[edi+5],0
call .str
popad
ret
align 4
.str:
mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®©
cmp eax,ecx ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
jb @f
xor edx,edx ;®ç¨áâ¨âì edx
div ecx ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
push edx ;¯®«®¦¨âì ¢ á⥪
;dec edi ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
pop eax
@@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
or al,0x30 ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥ 祬 ¤¢¥ ¢ëè¥
stosb ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
ret ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
align 4
proc str_cat, str1:dword, str2:dword
push eax ecx edi esi
mov esi,dword[str2]
stdcall str_len,esi
mov ecx,eax
inc ecx
mov edi,dword[str1]
stdcall str_len,edi
add edi,eax
cld
repne movsb
pop esi edi ecx eax
ret
endp
;output:
; eax = strlen
align 4
proc str_len, str1:dword
mov eax,[str1]
@@:
cmp byte[eax],0
je @f
inc eax
jmp @b
@@:
sub eax,[str1]
ret
endp
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
align 4
@ -1744,6 +1584,7 @@ buf_vox:
db 6,7,4,3 ;w,h,h_osn,n
rb BUF_STRUCT_SIZE*(3+1)
align 16
i_end:
wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
rq 0

File diff suppressed because it is too large Load Diff