diff --git a/programs/cmm/browser/HTMLv.c b/programs/cmm/browser/HTMLv.c
index d5e1b6e4ae..59106339c0 100644
--- a/programs/cmm/browser/HTMLv.c
+++ b/programs/cmm/browser/HTMLv.c
@@ -1,8 +1,9 @@
//HTML Viewer in C--
//Copyright 2007-2012 by Veliant & Leency
-//Asper, lev, Lrz, Barsuk, Nable.
+//Asper, lev, Lrz, Barsuk, Nable...
//home icon - rachel fu, GPL licence
+//libraries
#include "..\lib\kolibri.h"
#include "..\lib\strings.h"
#include "..\lib\figures.h"
@@ -10,13 +11,12 @@
#include "..\lib\file_system.h"
#include "..\lib\mem.h"
#include "..\lib\dll.h"
-//сшсышюЄхъш .obj
-#include "..\lib\libio_lib.h"
-#include "..\lib\libimg_lib.h"
-#include "..\lib\edit_box_lib.h"
-#include "..\lib\scroll_lib.h"
-#include "..\lib\truetype.h"
-//ърЁЄшэъш
+//*.obj libraries
+#include "..\lib\lib.obj\box_lib.h"
+#include "..\lib\lib.obj\libio_lib.h"
+#include "..\lib\lib.obj\libimg_lib.h"
+#include "..\lib\lib.obj\truetype.h"
+//images
#include "img\toolbar_icons.c"
#include "img\URLgoto.txt";
@@ -92,11 +92,10 @@ void main()
int scroll_used=0;
mem_Init();
- if (load_dll2(libio, #libio_init,1)!=0) debug("═х єфрыюё№ яюфъы■ўшЄ№ сшсышюЄхъє libio"w);
- if (load_dll2(libimg, #libimg_init,1)!=0) debug("═х єфрыюё№ яюфъы■ўшЄ№ сшсышюЄхъє libimg"w);
- if (load_dll2(boxlib, #edit_box_draw,0)!=0) {RunProgram("@notify", "System Error: library doesn't exists /rd/1/lib/box_lib.obj"); ExitProcess();}
- load_dll2(#abox_lib, #boxlib_init,0);
- if (load_dll2(libtruetype, #truetype,0)!=0) {debug("═х єфрыюё№ яюфъы■ўшЄ№ сшсышюЄхъє TrueType"w); use_truetype = 2; }
+ if (load_dll2(boxlib, #box_lib_init,0)!=0) {notify("System Error: library doesn't exists /rd/1/lib/box_lib.obj"); ExitProcess();}
+ if (load_dll2(libio, #libio_init,1)!=0) debug("Error: library doesn't exists - libio"w);
+ if (load_dll2(libimg, #libimg_init,1)!=0) debug("Error: library doesn't exists - libimg"w);
+ if (load_dll2(libtruetype, #truetype,0)!=0) {debug("Error: library doesn't exists - TrueType"w); use_truetype = 2; }
else init_font(#fontlol);
if (!URL) strcpy(#URL, "/sys/home.htm");
diff --git a/programs/cmm/browser/TWB.h b/programs/cmm/browser/TWB.h
index 4031139223..2e220496da 100644
--- a/programs/cmm/browser/TWB.h
+++ b/programs/cmm/browser/TWB.h
@@ -314,11 +314,11 @@ void TWebBrowser::ShowPage()
if (!filesize)
{
DrawBar(left, top, width+4, height, 0xFFFFFF); //чръЁр°штрхь тё╕ фюэшчє
- if (GetProcessSlot(downloader_id)<>0) WriteText(left + 10, top + 18, 0x80, 0, "Loading...", 0);
+ if (GetProcessSlot(downloader_id)<>0) WriteText(left + 10, top + 18, 0x80, 0, "Loading...");
else
{
- WriteText(left + 10, top + 18, 0x80, 0, "Page not found. May be, URL contains some errors.", 0);
- if (!strcmp(get_URL_part(5),"http:"))) WriteText(left + 10, top + 32, 0x80, 0, "Or Internet unavilable for your configuration.", 0);
+ WriteText(left + 10, top + 18, 0x80, 0, "Page not found. May be, URL contains some errors.");
+ if (!strcmp(get_URL_part(5),"http:"))) WriteText(left + 10, top + 32, 0x80, 0, "Or Internet unavilable for your configuration.");
}
//return;
}
@@ -551,14 +551,14 @@ void TWebBrowser::DrawPage() //
}
else
{
- WriteText(start_x, start_y, 0x80, text_colors[text_color_index], #line, 0);
+ WriteText(start_x, start_y, 0x80, text_colors[text_color_index], #line);
IF (b_text) { $add ebx, 1<<16 $int 0x40 }
}
IF (i_text) Skew(start_x, start_y, line_length+6, 10);
IF (s_text) DrawBar(start_x, start_y + 4, line_length, 1, text_colors[text_color_index]);
IF (u_text) DrawBar(start_x, start_y + 8, line_length, 1, text_colors[text_color_index]);
IF (link) {
- DefineButton(start_x-2, start_y, line_length + 3, 9, blink + BT_HIDE, 0xB5BFC9);
+ UnsafeDefineButton(start_x-2, start_y, line_length + 3, 9, blink + BT_HIDE, 0xB5BFC9);
DrawBar(start_x, start_y + 8, line_length, 1, text_colors[text_color_index]);
}
stolbec += strlen(#line);
diff --git a/programs/cmm/browser/include/menu_rmb.h b/programs/cmm/browser/include/menu_rmb.h
index 6d37a25049..11f6b6a8c9 100644
--- a/programs/cmm/browser/include/menu_rmb.h
+++ b/programs/cmm/browser/include/menu_rmb.h
@@ -85,7 +85,7 @@ void menu_rmb()
{
if (i<>items_cur) EDX=0xFFFFFF; else EDX=0x94AECE;
DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX);
- WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i*2],0);
+ WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i*2]);
if (ITEMS_LIST[i*2+1]==1) && (pre_text==2) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+8, 4, 4, 0x444444);
if (ITEMS_LIST[i*2+1]==5) && (use_truetype==1) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+8, 4, 4, 0x444444);
}
diff --git a/programs/cmm/lib/figures.h b/programs/cmm/lib/figures.h
index b519ea2a59..6c6d9075d5 100644
--- a/programs/cmm/lib/figures.h
+++ b/programs/cmm/lib/figures.h
@@ -1,3 +1,5 @@
+//#include "strings.h"
+
void DrawRectangle(dword x,y,width,height,color1)
{
DrawBar(x,y,width,1,color1);
diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h
index 073baffb60..b8dda73c0f 100644
--- a/programs/cmm/lib/kolibri.h
+++ b/programs/cmm/lib/kolibri.h
@@ -35,7 +35,7 @@ char program_path[4096];
struct mouse
{
- int x,y,lkm,pkm,hor,vert;
+ signed int x,y,lkm,pkm,hor,vert;
void get();
};
@@ -121,17 +121,17 @@ inline fastcall ScancodesGeting(){
inline fastcall word GetKey() //+Gluk fix
{
$push edx
-@getkey:
+GETKEY:
$mov eax,2
$int 0x40
$cmp eax,1
- $jne getkeyi
+ $jne GETKEYI
$mov ah,dh
- $jmp getkeyii //jz?
-@getkeyi:
+ $jmp GETKEYII //jz?
+GETKEYI:
$mov dh,ah
- $jmp getkey
-@getkeyii:
+ $jmp GETKEY
+GETKEYII:
$pop edx
$shr eax,8
}
@@ -187,14 +187,16 @@ struct proc_info
word status_slot,rezerv3;
dword work_left,work_top,work_width,work_height;
char status_window;
- void GetInfo( ECX);
- byte reserved[1024-71];
+ dword cwidth,cheight;
+ byte reserved[1024-71-8];
};
inline fastcall void GetProcessInfo( EBX, ECX)
{
$mov eax,9;
$int 0x40
+ DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth
+ DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight
}
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
@@ -320,14 +322,14 @@ inline fastcall void debug( EDX)
$push ecx
$mov eax, 63
$mov ebx, 1
-next_char:
+NEXT_CHAR:
$mov ecx, DSDWORD[edx]
$or cl, cl
- $jz done
+ $jz DONE
$int 0x40
$inc edx
- $jmp next_char
-done:
+ $jmp NEXT_CHAR
+DONE:
$mov cl, 13
$int 0x40
$mov cl, 10
@@ -361,15 +363,6 @@ void DefineAndDrawWindow(dword x,y, sizeX,sizeY, byte WindowType,dword WindowAre
$int 0x40
}
-inline fastcall DeleteAllButtons()
-{
- EAX = 12; // function 12:tell os about windowdraw
- EBX = 1;
- $int 0x40
- EBX = 2;
- $int 0x40
-}
-
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
{
$mov eax, 67
@@ -383,12 +376,23 @@ inline fastcall void DrawTitle( ECX)
$int 0x40;
}
-void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
+void WriteTextB(dword x,y,byte fontType, dword color, EDX)
{
EAX = 4;
EBX = x<<16+y;
ECX = fontType<<24+color;
$int 0x40;
+ $add ebx, 1<<16
+ $int 0x40
+}
+
+void WriteText(dword x,y,byte fontType, dword color, EDX)
+{
+ EAX = 4;
+ EBX = x<<16+y;
+ ECX = fontType<<24+color;
+ $xor esi, esi
+ $int 0x40;
}
void WriteNumber(dword x,y,byte fontType, dword color, count, ECX)
@@ -448,6 +452,7 @@ inline fastcall void PutPixel( EBX,ECX,EDX)
void DrawBar(dword x,y,w,h,EDX)
{
+ if (h<=0) || (h>65000) return; //bad boy :)
EAX = 13;
EBX = x<<16+w;
ECX = y<<16+h;
@@ -456,7 +461,19 @@ void DrawBar(dword x,y,w,h,EDX)
void DefineButton(dword x,y,w,h,EDX,ESI)
{
- EAX = 8;
+ EAX = 8;
+ $push edx
+ EDX += BT_DEL;
+ $int 0x40;
+ $pop edx
+ EBX = x<<16+w;
+ ECX = y<<16+h;
+ $int 0x40
+}
+
+void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
+{
+ EAX = 8;
EBX = x<<16+w;
ECX = y<<16+h;
$int 0x40
diff --git a/programs/cmm/lib/lib.obj/box_lib.h b/programs/cmm/lib/lib.obj/box_lib.h
new file mode 100644
index 0000000000..241d370dc2
--- /dev/null
+++ b/programs/cmm/lib/lib.obj/box_lib.h
@@ -0,0 +1,95 @@
+//BOX_LIB - Asper
+dword boxlib = #aEdit_box_lib;
+char aEdit_box_lib[22]="/sys/lib/box_lib.obj\0";
+
+dword box_lib_init = #aboxlib_init;
+
+dword edit_box_draw = #aEdit_box_draw;
+dword edit_box_key = #aEdit_box_key;
+dword edit_box_mouse = #aEdit_box_mouse;
+dword version_ed = #aVersion_ed;
+
+dword scrollbar_v_draw = #aScrollbar_v_draw;
+dword scrollbar_v_mouse = #aScrollbar_v_mouse;
+dword scrollbar_h_draw = #aScrollbar_h_draw;
+dword scrollbar_h_mouse = #aScrollbar_h_mouse;
+dword version_scrollbar = #aVersion_scrollbar;
+
+dword am__ = 0x0;
+dword bm__ = 0x0;
+
+char aEdit_box_draw[9] = "edit_box\0";
+char aEdit_box_key[13] = "edit_box_key\0";
+char aEdit_box_mouse[15] = "edit_box_mouse\0";
+char aVersion_ed[11] = "version_ed\0";
+
+char aboxlib_init[9] = "lib_init\0";
+char aScrollbar_v_draw[17] = "scrollbar_v_draw\0";
+char aScrollbar_v_mouse[18] = "scrollbar_v_mouse\0";
+char aScrollbar_h_draw[17] = "scrollbar_h_draw\0";
+char aScrollbar_h_mouse[18] = "scrollbar_h_mouse\0";
+char aVersion_scrollbar[18] = "version_scrollbar\0";
+
+char aCheck_box_draw [15] = "check_box_draw\0";
+char aCheck_box_mouse [16] = "check_box_mouse\0";
+char aVersion_ch [11] = "version_ch\0";
+
+char aOption_box_draw [16] = "option_box_draw\0";
+char aOption_box_mouse[17] = "option_box_mouse\0";
+char aVersion_op [11] = "version_op\0" ;
+
+
+struct edit_box{
+dword width, left, top, color, shift_color, focus_border_color, blur_border_color,
+text_color, max, text, mouse_variable, flags, size, pos, offset, cl_curs_x, cl_curs_y, shift, shift_old;
+};
+
+struct scroll_bar
+{
+word size_x,// equ [edi]
+start_x,// equ [edi+2]
+size_y,// equ [edi+4]
+start_y;// equ [edi+6]
+dword btn_height, //equ [edi+8]
+type,// equ [edi+12]
+max_area,// equ [edi+16]
+cur_area,// equ [edi+20]
+position,// equ [edi+24]
+bckg_col,// equ [edi+28]
+frnt_col,// equ [edi+32]
+line_col,// equ [edi+36]
+redraw;// equ [edi+40]
+word delta,// equ [edi+44]
+delta2,// equ [edi+46]
+r_size_x,// equ [edi+48]
+r_start_x,// equ [edi+50]
+r_size_y,// equ [edi+52]
+r_start_y;// equ [edi+54]
+dword m_pos,// equ [edi+56]
+m_pos_2,// equ [edi+60]
+m_keys,// equ [edi+64]
+run_size,// equ [edi+68]
+position2,// equ [edi+72]
+work_size,// equ [edi+76]
+all_redraw,// equ [edi+80]
+ar_offset;// equ [edi+84]
+};
+
+//ed_width equ [edi] ;ширина компонента
+//ed_left equ [edi+4] ;положение по оси х
+//ed_top equ [edi+8] ;положение по оси у
+//ed_color equ [edi+12] ;цвет фона компонента
+//shift_color equ [edi+16] ;=0x6a9480
+//ed_focus_border_color equ [edi+20] ;цвет рамки компонента
+//ed_blur_border_color equ [edi+24] ;цвет не активного компонента
+//ed_text_color equ [edi+28] ;цвет текста
+//ed_max equ [edi+32] ;кол-во символов которые можно максимально ввести
+//ed_text equ [edi+36] ;указатель на буфер
+//ed_flags equ [edi+40] ;флаги
+//ed_size equ [edi+42] ;кол-во символов
+//ed_pos equ [edi+46] ;позиция курсора
+//ed_offset equ [edi+50] ;смещение
+//cl_curs_x equ [edi+54] ;предыдущая координата курсора по х
+//cl_curs_y equ [edi+58] ;предыдущая координата курсора по у
+//ed_shift_pos equ [edi+62] ;положение курсора
+//ed_shift_pos_old equ [edi+66] ;старое положение курсора
diff --git a/programs/cmm/lib/lib.obj/iconv.h b/programs/cmm/lib/lib.obj/iconv.h
index d579f9bc40..6cc6267b36 100644
--- a/programs/cmm/lib/lib.obj/iconv.h
+++ b/programs/cmm/lib/lib.obj/iconv.h
@@ -1,4 +1,4 @@
-//Network library
+//convert text characters
dword iconv_lib = #a_iconv_lib;
char a_iconv_lib[19]="/sys/lib/iconv.obj\0";
@@ -29,7 +29,7 @@ dword ChangeCharset(dword from_chs, to_chs, conv_buf)
cd = EAX;
if (cd!=0)
{
- debug("iconv: semething is wrong with stdcall iconv()");
+ debug("iconv: something is wrong with stdcall iconv()");
debug(itoa(cd));
debug("in_len");
debug(itoa(in_len));
diff --git a/programs/cmm/lib/libimg_lib.h b/programs/cmm/lib/lib.obj/libimg_lib.h
similarity index 100%
rename from programs/cmm/lib/libimg_lib.h
rename to programs/cmm/lib/lib.obj/libimg_lib.h
diff --git a/programs/cmm/lib/libio_lib.h b/programs/cmm/lib/lib.obj/libio_lib.h
similarity index 100%
rename from programs/cmm/lib/libio_lib.h
rename to programs/cmm/lib/lib.obj/libio_lib.h
diff --git a/programs/cmm/lib/network.h b/programs/cmm/lib/lib.obj/network.h
similarity index 100%
rename from programs/cmm/lib/network.h
rename to programs/cmm/lib/lib.obj/network.h
diff --git a/programs/cmm/lib/truetype.h b/programs/cmm/lib/lib.obj/truetype.h
similarity index 100%
rename from programs/cmm/lib/truetype.h
rename to programs/cmm/lib/lib.obj/truetype.h
diff --git a/programs/cmm/lib/mem.h b/programs/cmm/lib/mem.h
index 06fcc894db..a5d338e5b1 100644
--- a/programs/cmm/lib/mem.h
+++ b/programs/cmm/lib/mem.h
@@ -1,5 +1,5 @@
-//mem.Init
-dword mem_Init()
+
+dword mem_init()
{
$push ebx
$mov eax, 68
@@ -10,8 +10,7 @@ dword mem_Init()
return EAX;
}
-//mem.Alloc
-dword mem_Alloc(dword size)
+dword malloc(dword size)
{
$push ebx
$push ecx
@@ -25,8 +24,7 @@ dword mem_Alloc(dword size)
return EAX;
}
-//mem.ReAlloc
-stdcall dword mem_ReAlloc(dword mptr, size)
+stdcall dword realloc(dword mptr, size)
{
$push ebx
$push ecx
@@ -43,8 +41,7 @@ stdcall dword mem_ReAlloc(dword mptr, size)
return EAX;
}
-//mem.Free
-void mem_Free(dword mptr)
+dword free(dword mptr)
{
$push eax
$push ebx
@@ -59,10 +56,10 @@ void mem_Free(dword mptr)
$pop ecx
$pop ebx
$pop eax
+ return 0;
}
-//stdcall dword ??
-inline fastcall mem_Move( EDI, ESI, ECX)
+inline fastcall memmov( EDI, ESI, ECX)
{
asm {
MOV EAX, ECX
@@ -92,6 +89,10 @@ L2:
}
}
+#define mem_Alloc malloc
+#define mem_ReAlloc realloc
+#define mem_Free free
+#define mem_Init mem_init
/*:void fastcall memsetz( EDI, ECX)
{
@@ -106,7 +107,7 @@ L2:
}
}
-:void fastcall memset( EDI, ECX, AL)
+:void fastcall memset( EDI, ECX, AL) //copy AL to EDI of ECX num (void *dest, size_t, char c )
{
asm {
MOV AH, AL
diff --git a/programs/cmm/lib/memory.h b/programs/cmm/lib/memory.h
deleted file mode 100644
index 475017e565..0000000000
--- a/programs/cmm/lib/memory.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#code32 TRUE
-
-inline fastcall dword malloc(dword ECX){
- dword size, heap;
- #speed
- size = ECX;
- EAX = 68;
- EBX = 11;
- $int 0x40;
- heap = EAX;
- IF (size<=heap)
- {
- EAX = 68;
- EBX = 12;
- ECX = size;
- $int 0x40;
- }
- ELSE EAX=-1;
- #codesize
-}
-
-inline fastcall dword free(dword ECX){
- #speed
- EAX = 68;
- EBX = 13;
- $int 0x40;
- #codesize
-}
-
-inline fastcall dword realloc(dword ECX, EDX){
- #speed
- EAX = 68;
- EBX = 20;
- $int 0x40;
- #codesize
-}
-
-inline fastcall memmov( EDI, ESI, ECX)
-{
- asm {
- MOV EAX, ECX
- CMP EDI, ESI
- JG L1
- JE L2
- SAR ECX, 2
- JS L2
- REP MOVSD
- MOV ECX, EAX
- AND ECX, 3
- REP MOVSB
- JMP SHORT L2
-L1: LEA ESI, DSDWORD[ ESI+ECX-4]
- LEA EDI, DSDWORD[ EDI+ECX-4]
- SAR ECX, 2
- JS L2
- STD
- REP MOVSD
- MOV ECX, EAX
- AND ECX, 3
- ADD ESI, 3
- ADD EDI, 3
- REP MOVSB
- CLD
-L2:
- }
-}
diff --git a/programs/cmm/lib/scroll_lib.h b/programs/cmm/lib/scroll_lib.h
deleted file mode 100644
index 75fac9b37f..0000000000
--- a/programs/cmm/lib/scroll_lib.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//lev
-//:dword boxlib = #abox_lib;
-char abox_lib[]="/sys/lib/box_lib.obj";
-
-char aboxlib_init[] = "lib_init";
-char aScrollbar_v_draw[] = "scrollbar_v_draw";
-char aScrollbar_v_mouse[] = "scrollbar_v_mouse";
-char aScrollbar_h_draw[] = "scrollbar_h_draw";
-char aScrollbar_h_mouse[] = "scrollbar_h_mouse";
-char aVersion_scrollbar[] = "version_scrollbar";
-
-dword boxlib_init = #aboxlib_init;
-dword scrollbar_v_draw = #aScrollbar_v_draw;
-dword scrollbar_v_mouse = #aScrollbar_v_mouse;
-dword scrollbar_h_draw = #aScrollbar_h_draw;
-dword scrollbar_h_mouse = #aScrollbar_h_mouse;
-dword version_scrollbar = #aVersion_scrollbar;
-
-dword sc_am__ = 0x0;
-dword sc_bm__ = 0x0;
-
-struct scroll_bar
-{
-//scroll_bar:
-word size_x,// equ [edi]
-start_x,// equ [edi+2]
-size_y,// equ [edi+4]
-start_y;// equ [edi+6]
-dword btn_height, // equ [edi+8]
-type,// equ [edi+12]
-max_area,// equ [edi+16]
-cur_area,// equ [edi+20]
-position,// equ [edi+24]
-bckg_col,// equ [edi+28]
-frnt_col,// equ [edi+32]
-line_col,// equ [edi+36]
-redraw;// equ [edi+40]
-word delta,// equ [edi+44]
-delta2,// equ [edi+46]
-r_size_x,// equ [edi+48]
-r_start_x,// equ [edi+50]
-r_size_y,// equ [edi+52]
-r_start_y;// equ [edi+54]
-dword m_pos,// equ [edi+56]
-m_pos_2,// equ [edi+60]
-m_keys,// equ [edi+64]
-run_size,// equ [edi+68]
-position2,// equ [edi+72]
-work_size,// equ [edi+76]
-all_redraw,// equ [edi+80]
-ar_offset;// equ [edi+84]
-};
-
-/*scroll_bar scroll1 = {
-18,//word size_x,
-200, //start_x,
-398, //size_y,
-44,//start_y;
-18,//dword btn_height,
-0,//type,
-115,//max_area, (100+cur_area)
-15,//cur_area,
-0,//position,
-0xeeeeee,//bckg_col,
-0xD2CED0,//frnt_col,
-0x555555,//line_col,
-0,//redraw;
-0,//word delta,
-0,//delta2,
-0,//r_size_x,
-0,//r_start_x,
-0,//r_size_y,
-0,//r_start_y;
-0,//dword m_pos,
-0,//m_pos_2,
-0,//m_keys,
-0,//run_size,
-0,//position2,
-0,//work_size,
-1,//all_redraw,
-1//ar_offset;
-};*/
-
-//btn_height - высота боковых кнопок (левая и правая для гориз. и верхняя и нижняя для верт.)
-//type - type - 0-1-2, остальные выглядят как 0.
-//max_area - область максимальная, актуально когда не влазит в отображаемую область, т.е. случай активности компонента (весь максимальный размер документа)
-//cur_area - размер бегунка//область отображаемая (какая часть документа влазит в экран)
-//position - позиция бегунка изменяемая от 0 до значения (max_area-cur_area)
-//bckg_col - цвет внутренний, применяется для областей между бегунком и кноками
-//frnt_col - цвет наружный, применяется для областей отличных от применяемых в bckg_col
-//line_col - цвет линий и стрелок на кнопках
-//redraw - индикатор необходимости перерисовки управляемой области учитывая изменение position и cur_area
-//delta2 - индикатор захвата фокуса скроллбаром (удержание бегунка)
-//all_redraw - флаг устанавливаемый в 1 для перерисовки всего компонента, если поставить 0, то перерисовка происходит только для области бегунка. Введено для ускорения отрисовки, поскольку не во всех случаях требуется принудитеьно отрисовывать все части компонента. Когда вызывается по событию мыши всегда отрисовывается самим компонентом со значением 0.
-//ar_offset - величина смещения при однократном нажатии боковой кнопки.
diff --git a/programs/cmm/lib/strings.h b/programs/cmm/lib/strings.h
index f6035ee5e4..9f8632eb06 100644
--- a/programs/cmm/lib/strings.h
+++ b/programs/cmm/lib/strings.h
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// strcmp( ESI, EDI)
// strlen( EDI)
-// strcpy( EDI, ESI)
+// strcpy( EDI, ESI) --- 0 if ==
// strcat( EDI, ESI)
// strchr( ESI,BL)
// strrchr( ESI,BL)
@@ -9,9 +9,11 @@
// itoa( ESI)
// atoi( EAX)
// strupr( ESI)
-// strlwr( ESI) ----- тючьюцэю эх яюффхЁцштрхЄ ъшЁшыышЎє
+// strlwr( ESI) --- kyrillic symbols may not work
// strttl( EDX)
// strtok( ESI)
+// strcpyb(dword searchin, copyin, startstr, endstr) --- copy string between strings
+//chrnum(dword searchin, char symbol) --- count of symbol in string
//------------------------------------------------------------------------------
inline fastcall signed int strcmp( ESI, EDI)
@@ -49,39 +51,6 @@ L1:
}
-
-/*
-
-inline fastcall signed int strcmpi( ESI,EDI)
-uses EBX
-{
- do{
- $lodsb
- IF(AL>='a')&&(AL<='z')AL-=0x20;
- BL=DSBYTE[(E)DI];
- IF(BL>='a')&&(BL<='z')BL-=0x20;
- AL-=BL;
- IF(!ZEROFLAG)BREAK;
- (E)DI++;
- }while(BL!=0);
-}
-
-inline char STRNCMPI((E)SI,(E)DI,(E)CX)
-{
- (E)AX=0;
- LOOPNZ((E)CX){
- $lodsb
- IF(AL>='a')&&(AL<='z')AL-=0x20;
- AH=DSBYTE[EDI];
- IF(AH>='a')&&(AH<='z')AH-=0x20;
- EDI++;
- IF(AL==0)||(AH==0)||(AL!=AH)BREAK;
- }
- AL=AL-AH;
-}*/
-
-
-
inline fastcall unsigned int strlen( EDI)
{
$xor eax, eax
@@ -94,11 +63,11 @@ inline fastcall unsigned int strlen( EDI)
inline fastcall strcpy( EDI, ESI)
{
$cld
-l2:
+L2:
$lodsb
$stosb
$test al,al
- $jnz l2
+ $jnz L2
}
@@ -156,17 +125,17 @@ dword itoa( ESI)
$mov eax, esi
$push -'0'
-f2:
+F2:
$xor edx, edx
$div ecx
$push edx
$test eax, eax
- $jnz f2
-f3:
+ $jnz F2
+F3:
$pop eax
$add al, '0'
$stosb
- $jnz f3
+ $jnz F3
$mov al, '\0'
$stosb
@@ -186,7 +155,7 @@ inline fastcall dword atoi( EDI)
BL=DSBYTE[ESI]-'0';
EAX=EAX*10+EBX;
ESI++;
- }while(DSBYTE[ESI]>0);
+ }while(DSBYTE[ESI]>='0');
IF(DSBYTE[EDI]=='-') -EAX;
}
@@ -294,6 +263,34 @@ LS3:
}
}
+//
+void strcpyb(dword searchin, copyin, startstr, endstr)
+{
+ dword startp, endp;
+ startp = strstr(searchin, startstr) + strlen(startstr);
+ endp = strstr(startp, endstr);
+ if (startp==endp) return;
+ do
+ {
+ DSBYTE[copyin] = DSBYTE[startp];
+ copyin++;
+ startp++;
+ }
+ while (startp=disk_num) selected=disk_num-1; //тюёёЄрэртыштрхЄ т√фхыхэшх - їюЁю°р Їшўр
@@ -188,7 +188,7 @@ void DrawTmpDisks()
for (i=0; i