forked from KolibriOS/kolibrios
bugfix Num,Caps,Scroll Lock & remove in dir libraries
git-svn-id: svn://kolibrios.org@1032 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
00b249be6f
commit
5b18f6aea9
52
programs/develop/libraries/box_lib/C--/lib/RANDOM.H--
Normal file
52
programs/develop/libraries/box_lib/C--/lib/RANDOM.H--
Normal file
@ -0,0 +1,52 @@
|
||||
/*******************************************************************************
|
||||
|
||||
MenuetOS MineSweeper
|
||||
Copyright (C) 2003 Ivan Poddubny
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
dword generator; // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
|
||||
|
||||
:int random(int max)
|
||||
// get pseudo-random number - ïîëó÷èòü ïñåâäîñëó÷àéíîå ÷èñëî
|
||||
{
|
||||
$rdtsc // eax & edx
|
||||
$xor eax,edx
|
||||
$not eax
|
||||
|
||||
EBX = generator;
|
||||
$ror ebx,3
|
||||
$xor ebx,0xdeadbeef
|
||||
EBX += EAX;
|
||||
generator = EBX;
|
||||
|
||||
EAX += EBX;
|
||||
EAX = EAX % max;
|
||||
return EAX;
|
||||
}
|
||||
|
||||
:randomize()
|
||||
// initialize random number generator - èíèöèàëèçèðîâàòü ãåíåðàòîð ñëó÷àéíûõ ÷èñåë
|
||||
{
|
||||
asm
|
||||
{
|
||||
mov eax,3
|
||||
int 0x40
|
||||
ror eax,16
|
||||
}
|
||||
generator = EAX;
|
||||
}
|
558
programs/develop/libraries/box_lib/C--/lib/kolibri.h--
Normal file
558
programs/develop/libraries/box_lib/C--/lib/kolibri.h--
Normal file
@ -0,0 +1,558 @@
|
||||
#startaddress 0
|
||||
#code32 TRUE
|
||||
|
||||
char os_name[8] = {'M','E','N','U','E','T','0','1'};
|
||||
dword os_version = 0x00000001;
|
||||
dword start_addr = #main;
|
||||
dword final_addr = #stop+32;
|
||||
dword alloc_mem = #stop+0x100;
|
||||
dword x86esp_reg = #stop+0x100;
|
||||
dword I_Param = 0x0;
|
||||
dword I_Icon = 0x0;
|
||||
dword skin_width;
|
||||
|
||||
//Events
|
||||
#define evMouse 6
|
||||
#define evButton 3
|
||||
#define evKey 2
|
||||
#define evReDraw 1
|
||||
#define evNet 8
|
||||
|
||||
//Button options
|
||||
#define BT_DEL 0x80000000
|
||||
#define BT_HIDE 0x40000000
|
||||
#define BT_NOFRAME 0x20000000
|
||||
|
||||
#define OLD -1
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
struct FileInfo{
|
||||
dword read, firstBlock, qnBlockRead, retPtr, Work;
|
||||
byte filedir;
|
||||
};
|
||||
//-------------------------------------------------------------------------
|
||||
struct system_colors{
|
||||
dword frame,grab,grab_button,grab_button_text,grab_text,work,work_button,work_button_text,work_text,work_graph;
|
||||
void get();
|
||||
};
|
||||
void system_colors::get()
|
||||
{
|
||||
EAX = 48;
|
||||
EBX = 3;
|
||||
ECX = #frame;
|
||||
EDX = 40;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
|
||||
int vert;
|
||||
struct mouse{
|
||||
dword x,y,lkm,pkm;
|
||||
void get();
|
||||
};
|
||||
|
||||
void mouse::get()
|
||||
{
|
||||
EAX = 37;
|
||||
EBX = 1;
|
||||
$int 0x40
|
||||
$mov ebx, eax
|
||||
$shr eax, 16
|
||||
$and ebx,0x0000FFFF
|
||||
x = EAX;
|
||||
y = EBX;
|
||||
EAX = 37;
|
||||
EBX = 2;
|
||||
$int 0x40
|
||||
$mov ebx, eax
|
||||
$and eax, 0x00000001
|
||||
$shr ebx, 1
|
||||
$and ebx, 0x00000001
|
||||
lkm = EAX;
|
||||
pkm = EBX;
|
||||
EAX = 37; //ª®«ñᨪ®
|
||||
EBX = 7;
|
||||
$int 0x40
|
||||
$mov ebx, eax
|
||||
$shr eax, 16
|
||||
$and ebx,0x0000FFFF
|
||||
//hor = EAX;
|
||||
vert = EBX;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
struct f70{
|
||||
dword func;
|
||||
dword param1;
|
||||
dword param2;
|
||||
dword param3;
|
||||
dword param4;
|
||||
char rezerv;
|
||||
dword name;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
struct BDVK{
|
||||
dword attr;
|
||||
byte type_name;
|
||||
byte rez1, rez2, rez3;
|
||||
dword timecreate;
|
||||
dword datecreate;
|
||||
dword timelastaccess;
|
||||
dword datelastaccess;
|
||||
dword timelastedit;
|
||||
dword datelastedit;
|
||||
dword sizelo;
|
||||
dword sizehi;
|
||||
char name[518];
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
struct proc_info{
|
||||
dword use_cpu;
|
||||
word pos_in_stack,num_slot,rezerv1;
|
||||
char name[11];
|
||||
char rezerv2;
|
||||
dword adress,use_memory,ID,left,top,width,height;
|
||||
word status_slot,rezerv3;
|
||||
dword work_left,work_top,work_width,work_height;
|
||||
char status_window;
|
||||
void getme();
|
||||
};
|
||||
|
||||
void proc_info::getme()
|
||||
{
|
||||
EAX = 9;
|
||||
EBX = #use_cpu;
|
||||
ECX = -1;
|
||||
$int 0x40
|
||||
}
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
Žâà¨á®¢ª ®ª
|
||||
{x_start|y_start}, {x_size|y_size}, color_back, color_title, color_frames
|
||||
|
||||
DrawWindow(
|
||||
EBX = [x_start][x_size]
|
||||
ECX = [y_start][y_size]
|
||||
EDX, ESI, EDI = [00RRGGBB]
|
||||
)
|
||||
*/
|
||||
|
||||
inline fastcall void DrawWindow(dword EBX, ECX, EDX, ESI, EDI){
|
||||
#speed
|
||||
EAX = 0; // function 0 : define and draw window
|
||||
$int 0x40
|
||||
#codesize
|
||||
}
|
||||
|
||||
inline fastcall void DrawButton(dword EBX, ECX, EDX, ESI){
|
||||
EAX = 8;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
inline fastcall dword WaitEvent(){
|
||||
EAX = 10; // wait here for event
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
inline fastcall void ExitProcess(){
|
||||
EAX = -1; // close this program
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
/*
|
||||
02 = GET KEY
|
||||
|
||||
ret: al 0 successful -> ah = key
|
||||
al 1 no key in buffer
|
||||
*/
|
||||
inline fastcall word GetKey(){
|
||||
EAX = 2; // just read this key from buffer
|
||||
$int 0x40
|
||||
// EAX = EAX >> 8;
|
||||
}
|
||||
|
||||
/*
|
||||
17 = GET PRESSED BUTTON ID
|
||||
|
||||
ret: al 0 successful -> ah = id number
|
||||
al 1 no key in buffer
|
||||
*/
|
||||
inline fastcall word GetButtonID(){
|
||||
EAX = 17; // Get ID
|
||||
$int 0x40
|
||||
EAX = EAX >> 8;
|
||||
}
|
||||
|
||||
/*
|
||||
04 = WRITE TEXT TO WINDOW
|
||||
|
||||
ebx [x start]*65536 + [y start]
|
||||
ecx text color 0x00RRGGBB
|
||||
edx pointer to text beginning
|
||||
esi text length
|
||||
ret: nothing changed
|
||||
*/
|
||||
inline fastcall void WriteTextXY(dword EBX, ECX, EDX, ESI){
|
||||
#speed
|
||||
EAX = 4;
|
||||
$int 0x40;
|
||||
#codesize
|
||||
}
|
||||
|
||||
/*
|
||||
13 = DRAW BAR
|
||||
|
||||
ebx [x start]*65536 + [x size]
|
||||
ecx [y start]*65536 + [y size]
|
||||
edx color 0x00RRGGBB
|
||||
ret: nothing changed
|
||||
*/
|
||||
inline fastcall void kos_DrawBar(dword EBX, ECX, EDX){
|
||||
#speed
|
||||
EAX = 13;
|
||||
$int 0x40
|
||||
#codesize
|
||||
}
|
||||
|
||||
/* function EBX=5 (GetBackgroun) ECX[]->EDX[], length ESI
|
||||
inline fastcall void GetBackground(dword ECX, EDX, ESI){
|
||||
#speed
|
||||
EAX = 39;
|
||||
EBX = 5;
|
||||
$int 0x40
|
||||
#codesize
|
||||
}*/
|
||||
|
||||
//CODED by Veliant
|
||||
/*eax = 38 - íîìåð ôóíêöèè
|
||||
ebx = [êîîðäèíàòà íà÷àëà ïî îñè x]*65536 + [êîîðäèíàòà êîíöà ïî îñè x]
|
||||
ecx = [êîîðäèíàòà íà÷àëà ïî îñè y]*65536 + [êîîðäèíàòà êîíöà ïî îñè y]
|
||||
edx = 0x00RRGGBB - öâåò
|
||||
edx = 0x01xxxxxx - ðèñîâàòü èíâåðñívé îòðåçîê (ìëàäøèå 24 áèòà èãíîðèðó³òñÿ) */
|
||||
inline fastcall void DrawLine(dword EBX, ECX, EDX){
|
||||
EAX = 38;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
inline fastcall void DrawTitle(dword ECX)
|
||||
{
|
||||
EAX = 71;
|
||||
EBX = 1;
|
||||
$int 0x40;
|
||||
}
|
||||
|
||||
inline fastcall dword GetSkinWidth()
|
||||
{
|
||||
EAX = 48;
|
||||
EBX = 4;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
inline fastcall void ChangeSkin(){
|
||||
EAX = 48;
|
||||
EBX = 8;
|
||||
ECX = #file_path;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
inline fastcall dword GetScreenWidth()
|
||||
{
|
||||
EAX = 14;
|
||||
EBX = 4;
|
||||
$int 0x40
|
||||
$shr eax, 16
|
||||
$and eax,0x0000FFFF
|
||||
}
|
||||
|
||||
inline fastcall void DeleteButton(dword EDX)
|
||||
{
|
||||
EAX = 8;
|
||||
EDX = EDX + BT_DEL;
|
||||
$int 0x40;
|
||||
}
|
||||
|
||||
inline fastcall dword LoadLibrary(dword ECX)
|
||||
{
|
||||
$mov eax, 68
|
||||
$mov ebx, 19
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
inline fastcall dword strlen(dword EDI)
|
||||
{
|
||||
#speed
|
||||
ECX=0;
|
||||
EAX=0;
|
||||
ECX--;
|
||||
$REPNE $SCASB
|
||||
EAX=EAX-2-ECX;
|
||||
#codesize
|
||||
}
|
||||
|
||||
//-1 - ¥ à ¢ë
|
||||
// 0 - ¥ à ¢ë
|
||||
inline fastcall dword strcmp(dword ESI,EDI)
|
||||
{
|
||||
dword strcmp_i,ret=-1,len1,len2,sovpadenij=0,str1,str2;
|
||||
str1=ESI;
|
||||
str2=EDI;
|
||||
len1=strlen(str1);
|
||||
len2=strlen(str2);
|
||||
IF (len1==len2)
|
||||
{
|
||||
FOR (strcmp_i=0;strcmp_i<len1;strcmp_i++)
|
||||
{
|
||||
EAX = str1+strcmp_i;
|
||||
EAX = ESBYTE[EAX];
|
||||
EBX = str2+strcmp_i;
|
||||
EBX = ESBYTE[EBX];
|
||||
IF (EAX==EBX) sovpadenij++;
|
||||
}
|
||||
IF (sovpadenij==len1) ret=0;
|
||||
} ELSE ret=-1;
|
||||
EAX = ret;
|
||||
}
|
||||
|
||||
inline fastcall dword upcase(dword ESI)
|
||||
{
|
||||
dword str, i;
|
||||
str = ESI;
|
||||
for (i=0;i<strlen(str);i++)
|
||||
{
|
||||
EAX = str+i;
|
||||
EDX = ESBYTE[EAX];
|
||||
IF (EDX>=97) && (EDX<=122) ESBYTE[str+i] = DL - 32; //a-z
|
||||
IF (EDX>=160) && (EDX<=175) ESBYTE[str+i] = DL - 32; //à-ï
|
||||
IF (EDX>=224) && (EDX<=239) ESBYTE[str+i] = DL - 80; //ð-ÿ
|
||||
IF (EDX == 241) ESBYTE[EAX] = 240; //¿
|
||||
}
|
||||
EAX = str;
|
||||
//EAX = ESDWORD[EAX];
|
||||
//if (EAX != 0x5249443C) $int 3;
|
||||
}
|
||||
|
||||
inline fastcall dword lowcase(dword ESI)
|
||||
{
|
||||
dword str=ESI, i;
|
||||
FOR (i=0;i<strlen(str);i++)
|
||||
{
|
||||
EAX = str+i;
|
||||
EDX = ESBYTE[EAX];
|
||||
IF (EDX>=65) && (EDX<=90) ESBYTE[str+i] = DL + 32; //a-z
|
||||
IF (EDX>=128) && (EDX<=143) ESBYTE[str+i] = DL + 32; //à-ï
|
||||
IF (EDX>=144) && (EDX<=159) ESBYTE[str+i] = DL + 80; //ð-ÿ
|
||||
IF (EDX == 240) ESBYTE[EAX] = 241; //¿
|
||||
}
|
||||
EAX = str;
|
||||
//EAX = ESDWORD[EAX];
|
||||
//if (EAX != 0x5249443C) $int 3;
|
||||
}
|
||||
|
||||
inline fastcall void dostowin (dword ESI)
|
||||
{
|
||||
dword stroka,dlina;
|
||||
stroka = ESI;
|
||||
while (BL=ESBYTE[ESI])
|
||||
{
|
||||
IF (BL>128)
|
||||
IF (BL>=240) ESBYTE[ESI] = BL - 16;
|
||||
ELSE ESBYTE[ESI] = BL - 64;
|
||||
ESI++;
|
||||
}
|
||||
}
|
||||
|
||||
void WindowRedrawStatus(dword i)
|
||||
{
|
||||
EAX = 12; // function 12:tell os about windowdraw
|
||||
EBX = i; // 1, start of draw
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,borderColour)
|
||||
{
|
||||
dword arg1, arg2, arg3, arg4;
|
||||
//
|
||||
arg1 = x << 16 + sizeX;
|
||||
arg2 = y << 16 + sizeY;
|
||||
arg3 = mainAreaType << 24 | mainAreaColour;
|
||||
arg4 = headerType << 24 | headerColour;
|
||||
//
|
||||
$mov eax, 0
|
||||
$mov ebx, arg1
|
||||
$mov ecx, arg2
|
||||
$mov edx, arg3
|
||||
$mov esi, arg4
|
||||
$mov edi, borderColour
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
void DefineButton(dword x,y,w,h,id,color)
|
||||
{
|
||||
DrawButton(x<<16+w, skin_width+y<<16+h, id, color);
|
||||
}
|
||||
|
||||
void WriteText(dword x,y,byte fontType, dword color, text, len)
|
||||
{
|
||||
EBX = x<<16+skin_width+y;
|
||||
ECX = fontType<<24+color;
|
||||
EDX = text;
|
||||
ESI = len;
|
||||
EAX = 4;
|
||||
$int 0x40;
|
||||
}
|
||||
|
||||
inline fastcall void PutPixel(dword EBX,ECX,EDX) //Coded by Leency :D
|
||||
{
|
||||
EAX=1;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
void DrawBar(dword x,y,w,h,color)
|
||||
{
|
||||
kos_DrawBar(x<<16+w,skin_width+y<<16+h,color);
|
||||
}
|
||||
|
||||
void DrawRegion(dword x,y,width,height,color1)
|
||||
{
|
||||
DrawBar(x,y,width,1,color1); //ïîëîñà ãîð ñâåðõó
|
||||
DrawBar(x,y+height,width,1,color1); //ïîëîñà ãîð ñíèçó
|
||||
DrawBar(x,y,1,height,color1); //ïîëîñà âåðò ñëåâà
|
||||
DrawBar(x+width,y,1,height+1,color1); //ïîëîñà âåðò ñïðàâà
|
||||
}
|
||||
|
||||
void DrawFlatButton(dword x,y,width,height,id,color,text)
|
||||
{
|
||||
DrawRegion(x,y,width,height,0x94AECE);
|
||||
DrawBar(x+1,y+1,width-1,1,0xFFFFFF); //ïîëîñà ãîð áåëàÿ
|
||||
DrawBar(x+1,y+height-1,width-2,1,0xC7C7C7); //òåíü âåðò
|
||||
DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //ïîëîñà âåðò áåëàÿ
|
||||
DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //òåíü âåðò
|
||||
DrawBar(x+2,y+2,width-3,height-3,color); //çàëèâêà
|
||||
IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //îïðåäåëÿåì êíîïêó
|
||||
WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,strlen(text));
|
||||
}
|
||||
|
||||
|
||||
void PutImage(dword buf,w,h,x,y)
|
||||
{
|
||||
int i,r,g,b;
|
||||
EDI=buf;
|
||||
EAX = 7;
|
||||
EBX = buf;
|
||||
ECX = w<<16+h;
|
||||
EDX = x<<16+y+skin_width;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
|
||||
void copystr(dword s,d)
|
||||
{
|
||||
$mov esi,s
|
||||
$mov edi,d
|
||||
$cld
|
||||
l1:
|
||||
$lodsb
|
||||
$stosb
|
||||
$test al,al
|
||||
$jnz l1
|
||||
}
|
||||
|
||||
|
||||
int pos,razr,backup,j=0,chislo;
|
||||
char buffer[11]="";
|
||||
inline fastcall dword IntToStr(dword ESI)
|
||||
{
|
||||
chislo=ESI;
|
||||
ECX=12;
|
||||
$push edi
|
||||
$mov edi,#buffer
|
||||
$xor al,al
|
||||
$cld
|
||||
$rep $stosb
|
||||
pos=razr=backup=j=0;
|
||||
if (chislo<0)
|
||||
{
|
||||
buffer[pos]='-';
|
||||
chislo=-1*chislo;
|
||||
pos++;
|
||||
}
|
||||
backup=chislo;
|
||||
do
|
||||
{
|
||||
backup=backup/10;
|
||||
razr++;
|
||||
}
|
||||
while (backup!=0);
|
||||
razr--;
|
||||
FOR (j=razr+pos;j>pos-1;j--)
|
||||
{
|
||||
backup=chislo/10;
|
||||
backup=backup*10;
|
||||
buffer[j]=chislo-backup+48;
|
||||
chislo=chislo/10;
|
||||
}
|
||||
//return #buffer;
|
||||
$pop edi;
|
||||
EAX = #buffer;
|
||||
}
|
||||
|
||||
|
||||
inline fastcall dword MoveSize(dword EBX,ECX,EDX,ESI)
|
||||
{
|
||||
EAX = 67;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
|
||||
f70 CopyFile_f;
|
||||
BDVK CopyFile_atr;
|
||||
inline fastcall dword CopyFile(dword EBX,ECX)
|
||||
{
|
||||
dword s, d, bufer=0;
|
||||
s = EBX;
|
||||
d = ECX;
|
||||
|
||||
CopyFile_f.func = 5;
|
||||
CopyFile_f.param1 = 0;
|
||||
CopyFile_f.param2 = 0;
|
||||
CopyFile_f.param3 = 0;
|
||||
CopyFile_f.param4 = #CopyFile_atr;
|
||||
CopyFile_f.rezerv = 0;
|
||||
CopyFile_f.name = s;
|
||||
$mov eax, 70
|
||||
$mov ebx, #CopyFile_f
|
||||
$int 0x40
|
||||
|
||||
if (EAX == 0)
|
||||
{
|
||||
bufer = malloc(CopyFile_atr.sizelo);
|
||||
CopyFile_f.func = 0;
|
||||
CopyFile_f.param1 = 0;
|
||||
CopyFile_f.param2 = 0;
|
||||
CopyFile_f.param3 = CopyFile_atr.sizelo;
|
||||
CopyFile_f.param4 = bufer;
|
||||
CopyFile_f.rezerv = 0;
|
||||
CopyFile_f.name = s;
|
||||
$mov eax, 70
|
||||
$mov ebx, #CopyFile_f
|
||||
$int 0x40
|
||||
|
||||
IF (EAX == 0)
|
||||
{
|
||||
CopyFile_f.func = 2;
|
||||
CopyFile_f.param1 = 0;
|
||||
CopyFile_f.param2 = 0;
|
||||
CopyFile_f.param3 = CopyFile_atr.sizelo;
|
||||
CopyFile_f.param4 = bufer;
|
||||
CopyFile_f.rezerv = 0;
|
||||
CopyFile_f.name = d;
|
||||
$mov eax, 70
|
||||
$mov ebx, #CopyFile_f
|
||||
$int 0x40
|
||||
}
|
||||
}
|
||||
|
||||
}
|
67
programs/develop/libraries/box_lib/C--/lib/load_bmp.h--
Normal file
67
programs/develop/libraries/box_lib/C--/lib/load_bmp.h--
Normal file
@ -0,0 +1,67 @@
|
||||
//Load BMP by Veliant
|
||||
|
||||
struct readimage{
|
||||
dword func, param1, param2, size, buffer;
|
||||
byte z;
|
||||
dword name;
|
||||
};
|
||||
|
||||
void Put_Image(dword x,y,w,h,name)
|
||||
{
|
||||
int i, j, size, off, off2;
|
||||
byte r, g, b;
|
||||
readimage image;
|
||||
dword buf;
|
||||
size=w*h*3+100;
|
||||
buf=malloc(size);
|
||||
image.func = 0;
|
||||
image.param1 = 0;
|
||||
image.param2 = 0;
|
||||
image.size = size;
|
||||
image.buffer = buf;
|
||||
image.z = 0;
|
||||
image.name = #path;
|
||||
EAX = 70;
|
||||
EBX = #image;
|
||||
$int 0x40;
|
||||
|
||||
for(i=0;i<h;i++)
|
||||
for (j=0;j<w/2;j++)
|
||||
{
|
||||
off=w*3*i+buf+0x36;
|
||||
off2=w-j*3+off;
|
||||
off=j*3+off;
|
||||
|
||||
r=ESBYTE[off2-3];
|
||||
g=ESBYTE[off2-2];
|
||||
b=ESBYTE[off2-1];
|
||||
ESBYTE[off2-3]=ESBYTE[off];
|
||||
ESBYTE[off2-2]=ESBYTE[off+1];
|
||||
ESBYTE[off2-1]=ESBYTE[off+2];
|
||||
ESBYTE[off]=r;
|
||||
ESBYTE[off+1]=g;
|
||||
ESBYTE[off+2]=b;
|
||||
}
|
||||
size=w*h;
|
||||
for(i=0;i<size/2;i++)
|
||||
{
|
||||
off=buf+0x36;
|
||||
off2=size-i*3+off;
|
||||
off=i*3+off;
|
||||
|
||||
r=ESBYTE[off2-3];
|
||||
g=ESBYTE[off2-2];
|
||||
b=ESBYTE[off2-1];
|
||||
ESBYTE[off2-3]=ESBYTE[off];
|
||||
ESBYTE[off2-2]=ESBYTE[off+1];
|
||||
ESBYTE[off2-1]=ESBYTE[off+2];
|
||||
ESBYTE[off]=r;
|
||||
ESBYTE[off+1]=g;
|
||||
ESBYTE[off+2]=b;
|
||||
}
|
||||
EAX = 7;
|
||||
EBX = buf+0x36;
|
||||
ECX = w<<16+h;
|
||||
EDX = x<<16+y+skin_width;
|
||||
$int 0x40
|
||||
}
|
36
programs/develop/libraries/box_lib/C--/lib/memory.h--
Normal file
36
programs/develop/libraries/box_lib/C--/lib/memory.h--
Normal file
@ -0,0 +1,36 @@
|
||||
#code32 TRUE
|
||||
dword heap;
|
||||
inline fastcall dword malloc(dword ECX){
|
||||
dword size;
|
||||
#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
|
||||
}
|
96
programs/develop/libraries/box_lib/C--/trunk/EditBox2.c--
Normal file
96
programs/develop/libraries/box_lib/C--/trunk/EditBox2.c--
Normal file
@ -0,0 +1,96 @@
|
||||
//EditBox in C-- example v0.1
|
||||
//Veliant 2007 Leency 2008
|
||||
|
||||
#pragma option A
|
||||
#codesize
|
||||
#include "..\lib\kolibri.h--"
|
||||
#include "use_library.h--"
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//Bit mask from editbox
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
//char edit_path[256] = "You can edit me!"; //ᮤ¥à¦¨¬®¥ EditBox'a
|
||||
char way_of_ini[250] = "/sys/lib/box_lib.obj",NULL; //ᮤ¥à¦¨¬®¥ EditBox'a
|
||||
|
||||
edit_box edit1= {250,14,35,0xffffff,0x6f9480,0,0xAABBCC,0,248,#way_of_ini,2,20,20};
|
||||
|
||||
//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] ;áâ ஥ ¯®«®¦¥¨¥ ªãàá®à
|
||||
|
||||
proc_info Form;
|
||||
|
||||
|
||||
void main()
|
||||
byte id;
|
||||
{
|
||||
load_dll();
|
||||
|
||||
draw_window();
|
||||
loop()
|
||||
{
|
||||
switch(WaitEvent())
|
||||
{
|
||||
//Button pressed----------------------------------------------------
|
||||
CASE evButton:
|
||||
id=GetButtonID();
|
||||
IF (id==1) || (id==2) ExitProcess();
|
||||
break;
|
||||
//Key pressed-------------------------------------------------------
|
||||
case evKey:
|
||||
GetKey();
|
||||
edit_box_key stdcall (#edit1);
|
||||
break;
|
||||
|
||||
case evReDraw: draw_window(); break;
|
||||
// default: break;
|
||||
}
|
||||
|
||||
|
||||
edit_box_mouse stdcall (#edit1);
|
||||
|
||||
}
|
||||
|
||||
ExitProcess();
|
||||
}
|
||||
|
||||
void draw_window()
|
||||
{
|
||||
WindowRedrawStatus(1);
|
||||
skin_width = GetSkinWidth();
|
||||
DefineAndDrawWindow(400,200,280,200,0x04,0x00E4DFE1,0,0,0); DrawTitle("Extended EditBox in C--");
|
||||
Form.getme();
|
||||
//òåêñò
|
||||
WriteText(30,40,0x80,0,"<22> ¨¯à®á⥩訩 ¯à¨¬¥à EditBox'a ‘--",0);
|
||||
WriteText(30,50,0x80,0,"<22>® ¥£® ¬®¦® ¥¬®£® ãá«®¦¨âì á 楫ìî",0);
|
||||
WriteText(30,60,0x80,0,"㬥ìè¥¨ï ¯¥à¥à¨á®¢ª¨.",0);
|
||||
//êíîïû
|
||||
DrawFlatButton(100,105,70,22,2,0xD7D7D7,"Close");
|
||||
//EditBox
|
||||
// DrawRegion(30,14,201,16,0x94AECE); //®¡®¤®ª ¯®«®áë ¤à¥á
|
||||
|
||||
|
||||
edit_box_draw stdcall (#edit1);
|
||||
// typedef void (*edit_box_draw)(dword edit_b); // ®¡ê¥¨¥ 㪠§ ⥫ï äãªæ¨î
|
||||
// edit_box_draw(edit_b); // ¢ë§®¢ äãªæ¨¨
|
||||
|
||||
WindowRedrawStatus(2);
|
||||
}
|
||||
|
||||
|
||||
stop:
|
952
programs/develop/libraries/box_lib/C--/trunk/EditBox2.lst
Normal file
952
programs/develop/libraries/box_lib/C--/trunk/EditBox2.lst
Normal file
@ -0,0 +1,952 @@
|
||||
SPHINX/SHEKER C-- One Pass Disassembler. Version 0.239c b26 Apr 27 2007
|
||||
|
||||
..\lib\kolibri.h-- 4: char os_name[8] = {'M','E','N','U','E','T','0','1'};
|
||||
00000000 4D454E5545543031 db 4Dh,45h,4Eh,55h,45h,54h,30h,31h
|
||||
|
||||
..\lib\kolibri.h-- 5: dword os_version = 0x00000001;
|
||||
00000008 01000000 dd 1
|
||||
|
||||
..\lib\kolibri.h-- 6: dword start_addr = #main;
|
||||
0000000C 88050000 dd 588h
|
||||
|
||||
..\lib\kolibri.h-- 7: dword final_addr = #stop+32;
|
||||
00000010 5D070000 dd 75Dh
|
||||
|
||||
..\lib\kolibri.h-- 8: dword alloc_mem = #stop+0x100;
|
||||
00000014 3D080000 dd 83Dh
|
||||
|
||||
..\lib\kolibri.h-- 9: dword x86esp_reg = #stop+0x100;
|
||||
00000018 3D080000 dd 83Dh
|
||||
|
||||
..\lib\kolibri.h-- 10: dword I_Param = 0x0;
|
||||
0000001C 00000000 dd 0
|
||||
|
||||
..\lib\kolibri.h-- 11: dword I_Icon = 0x0;
|
||||
00000020 00000000 dd 0
|
||||
|
||||
..\lib\kolibri.h-- 39: void system_colors::get()
|
||||
00000024 55 push ebp
|
||||
00000025 89E5 mov ebp,esp
|
||||
|
||||
..\lib\kolibri.h-- 41: EAX = 48;
|
||||
00000027 6A30 push 30h
|
||||
00000029 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 42: EBX = 3;
|
||||
0000002A 6A03 push 3
|
||||
0000002C 5B pop ebx
|
||||
|
||||
..\lib\kolibri.h-- 43: ECX = #frame;
|
||||
0000002D 8B4D08 mov ecx,[ebp+8]
|
||||
|
||||
..\lib\kolibri.h-- 44: EDX = 40;
|
||||
00000030 6A28 push 28h
|
||||
00000032 5A pop edx
|
||||
|
||||
..\lib\kolibri.h-- 45: $int 0x40
|
||||
00000033 CD40 int 40h
|
||||
00000035 5D pop ebp
|
||||
00000036 C20400 ret 4
|
||||
|
||||
..\lib\kolibri.h-- 55: void mouse::get()
|
||||
00000039 55 push ebp
|
||||
0000003A 89E5 mov ebp,esp
|
||||
|
||||
..\lib\kolibri.h-- 57: EAX = 37;
|
||||
0000003C 6A25 push 25h
|
||||
0000003E 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 58: EBX = 1;
|
||||
0000003F 31DB xor ebx,ebx
|
||||
00000041 43 inc ebx
|
||||
|
||||
..\lib\kolibri.h-- 59: $int 0x40
|
||||
00000042 CD40 int 40h
|
||||
|
||||
..\lib\kolibri.h-- 60: $mov ebx, eax
|
||||
00000044 89C3 mov ebx,eax
|
||||
|
||||
..\lib\kolibri.h-- 61: $shr eax, 16
|
||||
00000046 C1E810 shr eax,10h
|
||||
|
||||
..\lib\kolibri.h-- 62: $and ebx,0x0000FFFF
|
||||
00000049 81E3FFFF0000 and ebx,0FFFFh
|
||||
|
||||
..\lib\kolibri.h-- 63: x = EAX;
|
||||
0000004F 8B7508 mov esi,[ebp+8]
|
||||
00000052 8906 mov [esi],eax
|
||||
|
||||
..\lib\kolibri.h-- 64: y = EBX;
|
||||
00000054 895E04 mov [esi+4],ebx
|
||||
|
||||
..\lib\kolibri.h-- 65: EAX = 37;
|
||||
00000057 6A25 push 25h
|
||||
00000059 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 66: EBX = 2;
|
||||
0000005A 6A02 push 2
|
||||
0000005C 5B pop ebx
|
||||
|
||||
..\lib\kolibri.h-- 67: $int 0x40
|
||||
0000005D CD40 int 40h
|
||||
|
||||
..\lib\kolibri.h-- 68: $mov ebx, eax
|
||||
0000005F 89C3 mov ebx,eax
|
||||
|
||||
..\lib\kolibri.h-- 69: $and eax, 0x00000001
|
||||
00000061 83E001 and eax,1
|
||||
|
||||
..\lib\kolibri.h-- 70: $shr ebx, 1
|
||||
00000064 D1EB shr ebx,1
|
||||
|
||||
..\lib\kolibri.h-- 71: $and ebx, 0x00000001
|
||||
00000066 83E301 and ebx,1
|
||||
|
||||
..\lib\kolibri.h-- 72: lkm = EAX;
|
||||
00000069 8B7508 mov esi,[ebp+8]
|
||||
0000006C 894608 mov [esi+8],eax
|
||||
|
||||
..\lib\kolibri.h-- 73: pkm = EBX;
|
||||
0000006F 895E0C mov [esi+0Ch],ebx
|
||||
|
||||
..\lib\kolibri.h-- 74: EAX = 37; //ª®«ñᨪ®
|
||||
00000072 6A25 push 25h
|
||||
00000074 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 75: EBX = 7;
|
||||
00000075 6A07 push 7
|
||||
00000077 5B pop ebx
|
||||
|
||||
..\lib\kolibri.h-- 76: $int 0x40
|
||||
00000078 CD40 int 40h
|
||||
|
||||
..\lib\kolibri.h-- 77: $mov ebx, eax
|
||||
0000007A 89C3 mov ebx,eax
|
||||
|
||||
..\lib\kolibri.h-- 78: $shr eax, 16
|
||||
0000007C C1E810 shr eax,10h
|
||||
|
||||
..\lib\kolibri.h-- 79: $and ebx,0x0000FFFF
|
||||
0000007F 81E3FFFF0000 and ebx,0FFFFh
|
||||
|
||||
..\lib\kolibri.h-- 81: vert = EBX;
|
||||
00000085 891D88070000 mov [788h],ebx
|
||||
0000008B 5D pop ebp
|
||||
0000008C C20400 ret 4
|
||||
|
||||
..\lib\kolibri.h-- 123: void proc_info::getme()
|
||||
0000008F 55 push ebp
|
||||
00000090 89E5 mov ebp,esp
|
||||
|
||||
..\lib\kolibri.h-- 125: EAX = 9;
|
||||
00000092 6A09 push 9
|
||||
00000094 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 126: EBX = #use_cpu;
|
||||
00000095 8B5D08 mov ebx,[ebp+8]
|
||||
|
||||
..\lib\kolibri.h-- 127: ECX = -1;
|
||||
00000098 83C9FF or ecx,0FFFFFFFFh
|
||||
|
||||
..\lib\kolibri.h-- 128: $int 0x40
|
||||
0000009B CD40 int 40h
|
||||
0000009D 5D pop ebp
|
||||
0000009E C20400 ret 4
|
||||
|
||||
..\lib\kolibri.h-- 367: void WindowRedrawStatus(dword i)
|
||||
000000A1 55 push ebp
|
||||
000000A2 89E5 mov ebp,esp
|
||||
|
||||
..\lib\kolibri.h-- 369: EAX = 12; // function 12:tell os about windowdraw
|
||||
000000A4 6A0C push 0Ch
|
||||
000000A6 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 370: EBX = i; // 1, start of draw
|
||||
000000A7 8B5D08 mov ebx,[ebp+8]
|
||||
|
||||
..\lib\kolibri.h-- 371: $int 0x40
|
||||
000000AA CD40 int 40h
|
||||
000000AC 5D pop ebp
|
||||
000000AD C20400 ret 4
|
||||
|
||||
..\lib\kolibri.h-- 374: void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,border
|
||||
000000B0 C8100000 enter 10h,0
|
||||
|
||||
..\lib\kolibri.h-- 378: arg1 = x << 16 + sizeX;
|
||||
000000B4 8B4528 mov eax,[ebp+28h]
|
||||
000000B7 C1E010 shl eax,10h
|
||||
000000BA 034520 add eax,[ebp+20h]
|
||||
000000BD 8945FC mov [ebp-4],eax
|
||||
|
||||
..\lib\kolibri.h-- 379: arg2 = y << 16 + sizeY;
|
||||
000000C0 8B4524 mov eax,[ebp+24h]
|
||||
000000C3 C1E010 shl eax,10h
|
||||
000000C6 03451C add eax,[ebp+1Ch]
|
||||
000000C9 8945F8 mov [ebp-8],eax
|
||||
|
||||
..\lib\kolibri.h-- 380: arg3 = mainAreaType << 24 | mainAreaColour;
|
||||
000000CC 0FB64518 movzx eax,[ebp+18h]
|
||||
000000D0 C1E018 shl eax,18h
|
||||
000000D3 0B4514 or eax,[ebp+14h]
|
||||
000000D6 8945F4 mov [ebp-0Ch],eax
|
||||
|
||||
..\lib\kolibri.h-- 381: arg4 = headerType << 24 | headerColour;
|
||||
000000D9 0FB64510 movzx eax,[ebp+10h]
|
||||
000000DD C1E018 shl eax,18h
|
||||
000000E0 0B450C or eax,[ebp+0Ch]
|
||||
000000E3 8945F0 mov [ebp-10h],eax
|
||||
|
||||
..\lib\kolibri.h-- 383: $mov eax, 0
|
||||
000000E6 B800000000 mov eax,0
|
||||
|
||||
..\lib\kolibri.h-- 384: $mov ebx, arg1
|
||||
000000EB 8B5DFC mov ebx,[ebp-4]
|
||||
|
||||
..\lib\kolibri.h-- 385: $mov ecx, arg2
|
||||
000000EE 8B4DF8 mov ecx,[ebp-8]
|
||||
|
||||
..\lib\kolibri.h-- 386: $mov edx, arg3
|
||||
000000F1 8B55F4 mov edx,[ebp-0Ch]
|
||||
|
||||
..\lib\kolibri.h-- 387: $mov esi, arg4
|
||||
000000F4 8B75F0 mov esi,[ebp-10h]
|
||||
|
||||
..\lib\kolibri.h-- 388: $mov edi, borderColour
|
||||
000000F7 8B7D08 mov edi,[ebp+8]
|
||||
|
||||
..\lib\kolibri.h-- 389: $int 0x40
|
||||
000000FA CD40 int 40h
|
||||
000000FC C9 leave
|
||||
000000FD C22400 ret 24h
|
||||
|
||||
..\lib\kolibri.h-- 392: void DefineButton(dword x,y,w,h,id,color)
|
||||
00000100 55 push ebp
|
||||
00000101 89E5 mov ebp,esp
|
||||
|
||||
..\lib\kolibri.h-- 394: DrawButton(x<<16+w, skin_width+y<<16+h, id, color);
|
||||
00000103 8B5D1C mov ebx,[ebp+1Ch]
|
||||
00000106 C1E310 shl ebx,10h
|
||||
00000109 035D14 add ebx,[ebp+14h]
|
||||
0000010C 8B0D84070000 mov ecx,[784h]
|
||||
00000112 034D18 add ecx,[ebp+18h]
|
||||
00000115 C1E110 shl ecx,10h
|
||||
00000118 034D10 add ecx,[ebp+10h]
|
||||
0000011B 8B550C mov edx,[ebp+0Ch]
|
||||
0000011E 8B7508 mov esi,[ebp+8]
|
||||
00000121 E84E060000 call 774h
|
||||
00000126 5D pop ebp
|
||||
00000127 C21800 ret 18h
|
||||
|
||||
..\lib\kolibri.h-- 397: void WriteText(dword x,y,byte fontType, dword color, text, len)
|
||||
0000012A 55 push ebp
|
||||
0000012B 89E5 mov ebp,esp
|
||||
|
||||
..\lib\kolibri.h-- 399: EBX = x<<16+skin_width+y;
|
||||
0000012D 8B5D1C mov ebx,[ebp+1Ch]
|
||||
00000130 C1E310 shl ebx,10h
|
||||
00000133 031D84070000 add ebx,[784h]
|
||||
00000139 035D18 add ebx,[ebp+18h]
|
||||
|
||||
..\lib\kolibri.h-- 400: ECX = fontType<<24+color;
|
||||
0000013C 0FB64D14 movzx ecx,[ebp+14h]
|
||||
00000140 C1E118 shl ecx,18h
|
||||
00000143 034D10 add ecx,[ebp+10h]
|
||||
|
||||
..\lib\kolibri.h-- 401: EDX = text;
|
||||
00000146 8B550C mov edx,[ebp+0Ch]
|
||||
|
||||
..\lib\kolibri.h-- 402: ESI = len;
|
||||
00000149 8B7508 mov esi,[ebp+8]
|
||||
|
||||
..\lib\kolibri.h-- 403: EAX = 4;
|
||||
0000014C 6A04 push 4
|
||||
0000014E 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 404: $int 0x40;
|
||||
0000014F CD40 int 40h
|
||||
00000151 5D pop ebp
|
||||
00000152 C21800 ret 18h
|
||||
|
||||
..\lib\kolibri.h-- 413: void DrawBar(dword x,y,w,h,color)
|
||||
00000155 55 push ebp
|
||||
00000156 89E5 mov ebp,esp
|
||||
|
||||
..\lib\kolibri.h-- 415: kos_DrawBar(x<<16+w,skin_width+y<<16+h,color);
|
||||
00000158 8B5D18 mov ebx,[ebp+18h]
|
||||
0000015B C1E310 shl ebx,10h
|
||||
0000015E 035D10 add ebx,[ebp+10h]
|
||||
00000161 8B0D84070000 mov ecx,[784h]
|
||||
00000167 034D14 add ecx,[ebp+14h]
|
||||
0000016A C1E110 shl ecx,10h
|
||||
0000016D 034D0C add ecx,[ebp+0Ch]
|
||||
00000170 8B5508 mov edx,[ebp+8]
|
||||
00000173 E8D2050000 call 74Ah
|
||||
00000178 5D pop ebp
|
||||
00000179 C21400 ret 14h
|
||||
|
||||
..\lib\kolibri.h-- 418: void DrawRegion(dword x,y,width,height,color1)
|
||||
0000017C 55 push ebp
|
||||
0000017D 89E5 mov ebp,esp
|
||||
|
||||
..\lib\kolibri.h-- 420: DrawBar(x,y,width,1,color1); //ïîëîñà ãîð ñâåðõó
|
||||
0000017F FF7518 push dword ptr [ebp+18h]
|
||||
00000182 FF7514 push dword ptr [ebp+14h]
|
||||
00000185 FF7510 push dword ptr [ebp+10h]
|
||||
00000188 6A01 push 1
|
||||
0000018A FF7508 push dword ptr [ebp+8]
|
||||
0000018D E8C3FFFFFF call 155h
|
||||
|
||||
..\lib\kolibri.h-- 421: DrawBar(x,y+height,width,1,color1); //ïîëîñà ãîð ñíèçó
|
||||
00000192 FF7518 push dword ptr [ebp+18h]
|
||||
00000195 8B4514 mov eax,[ebp+14h]
|
||||
00000198 03450C add eax,[ebp+0Ch]
|
||||
0000019B 50 push eax
|
||||
0000019C FF7510 push dword ptr [ebp+10h]
|
||||
0000019F 6A01 push 1
|
||||
000001A1 FF7508 push dword ptr [ebp+8]
|
||||
000001A4 E8ACFFFFFF call 155h
|
||||
|
||||
..\lib\kolibri.h-- 422: DrawBar(x,y,1,height,color1); //ïîëîñà âåðò ñëåâà
|
||||
000001A9 FF7518 push dword ptr [ebp+18h]
|
||||
000001AC FF7514 push dword ptr [ebp+14h]
|
||||
000001AF 6A01 push 1
|
||||
000001B1 FF750C push dword ptr [ebp+0Ch]
|
||||
000001B4 FF7508 push dword ptr [ebp+8]
|
||||
000001B7 E899FFFFFF call 155h
|
||||
|
||||
..\lib\kolibri.h-- 423: DrawBar(x+width,y,1,height+1,color1); //ïîëîñà âåðò ñïðàâà
|
||||
000001BC 8B4518 mov eax,[ebp+18h]
|
||||
000001BF 034510 add eax,[ebp+10h]
|
||||
000001C2 50 push eax
|
||||
000001C3 FF7514 push dword ptr [ebp+14h]
|
||||
000001C6 6A01 push 1
|
||||
000001C8 8B450C mov eax,[ebp+0Ch]
|
||||
000001CB 40 inc eax
|
||||
000001CC 50 push eax
|
||||
000001CD FF7508 push dword ptr [ebp+8]
|
||||
000001D0 E880FFFFFF call 155h
|
||||
000001D5 5D pop ebp
|
||||
000001D6 C21400 ret 14h
|
||||
|
||||
..\lib\kolibri.h-- 426: void DrawFlatButton(dword x,y,width,height,id,color,text)
|
||||
000001D9 55 push ebp
|
||||
000001DA 89E5 mov ebp,esp
|
||||
|
||||
..\lib\kolibri.h-- 428: DrawRegion(x,y,width,height,0x94AECE);
|
||||
000001DC FF7520 push dword ptr [ebp+20h]
|
||||
000001DF FF751C push dword ptr [ebp+1Ch]
|
||||
000001E2 FF7518 push dword ptr [ebp+18h]
|
||||
000001E5 FF7514 push dword ptr [ebp+14h]
|
||||
000001E8 68CEAE9400 push 94AECEh
|
||||
000001ED E88AFFFFFF call 17Ch
|
||||
|
||||
..\lib\kolibri.h-- 429: DrawBar(x+1,y+1,width-1,1,0xFFFFFF); //ïîëîñà ãîð áåëàÿ
|
||||
000001F2 8B4520 mov eax,[ebp+20h]
|
||||
000001F5 40 inc eax
|
||||
000001F6 50 push eax
|
||||
000001F7 8B451C mov eax,[ebp+1Ch]
|
||||
000001FA 40 inc eax
|
||||
000001FB 50 push eax
|
||||
000001FC 8B4518 mov eax,[ebp+18h]
|
||||
000001FF 48 dec eax
|
||||
00000200 50 push eax
|
||||
00000201 6A01 push 1
|
||||
00000203 68FFFFFF00 push 0FFFFFFh
|
||||
00000208 E848FFFFFF call 155h
|
||||
|
||||
..\lib\kolibri.h-- 430: DrawBar(x+1,y+height-1,width-2,1,0xC7C7C7); //òåíü âåðò
|
||||
0000020D 8B4520 mov eax,[ebp+20h]
|
||||
00000210 40 inc eax
|
||||
00000211 50 push eax
|
||||
00000212 8B451C mov eax,[ebp+1Ch]
|
||||
00000215 034514 add eax,[ebp+14h]
|
||||
00000218 48 dec eax
|
||||
00000219 50 push eax
|
||||
0000021A 8B4518 mov eax,[ebp+18h]
|
||||
0000021D 48 dec eax
|
||||
0000021E 48 dec eax
|
||||
0000021F 50 push eax
|
||||
00000220 6A01 push 1
|
||||
00000222 68C7C7C700 push 0C7C7C7h
|
||||
00000227 E829FFFFFF call 155h
|
||||
|
||||
..\lib\kolibri.h-- 431: DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //ïîëîñà âåðò áåëàÿ
|
||||
0000022C 8B4520 mov eax,[ebp+20h]
|
||||
0000022F 40 inc eax
|
||||
00000230 50 push eax
|
||||
00000231 8B451C mov eax,[ebp+1Ch]
|
||||
00000234 40 inc eax
|
||||
00000235 50 push eax
|
||||
00000236 6A01 push 1
|
||||
00000238 8B4514 mov eax,[ebp+14h]
|
||||
0000023B 48 dec eax
|
||||
0000023C 50 push eax
|
||||
0000023D 68FFFFFF00 push 0FFFFFFh
|
||||
00000242 E80EFFFFFF call 155h
|
||||
|
||||
..\lib\kolibri.h-- 432: DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //òåíü âåðò
|
||||
00000247 8B4520 mov eax,[ebp+20h]
|
||||
0000024A 034518 add eax,[ebp+18h]
|
||||
0000024D 48 dec eax
|
||||
0000024E 50 push eax
|
||||
0000024F 8B451C mov eax,[ebp+1Ch]
|
||||
00000252 40 inc eax
|
||||
00000253 40 inc eax
|
||||
00000254 50 push eax
|
||||
00000255 6A01 push 1
|
||||
00000257 8B4514 mov eax,[ebp+14h]
|
||||
0000025A 48 dec eax
|
||||
0000025B 48 dec eax
|
||||
0000025C 50 push eax
|
||||
0000025D 68C7C7C700 push 0C7C7C7h
|
||||
00000262 E8EEFEFFFF call 155h
|
||||
|
||||
..\lib\kolibri.h-- 433: DrawBar(x+2,y+2,width-3,height-3,color); //çàëèâêà
|
||||
00000267 8B4520 mov eax,[ebp+20h]
|
||||
0000026A 40 inc eax
|
||||
0000026B 40 inc eax
|
||||
0000026C 50 push eax
|
||||
0000026D 8B451C mov eax,[ebp+1Ch]
|
||||
00000270 40 inc eax
|
||||
00000271 40 inc eax
|
||||
00000272 50 push eax
|
||||
00000273 8B4518 mov eax,[ebp+18h]
|
||||
00000276 83E803 sub eax,3
|
||||
00000279 50 push eax
|
||||
0000027A 8B4514 mov eax,[ebp+14h]
|
||||
0000027D 83E803 sub eax,3
|
||||
00000280 50 push eax
|
||||
00000281 FF750C push dword ptr [ebp+0Ch]
|
||||
00000284 E8CCFEFFFF call 155h
|
||||
|
||||
..\lib\kolibri.h-- 434: IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //îïðåäåëÿåì êíîïêó
|
||||
00000289 837D1000 cmp dword ptr [ebp+10h],0
|
||||
0000028D 741F je 2AEh
|
||||
0000028F FF7520 push dword ptr [ebp+20h]
|
||||
00000292 FF751C push dword ptr [ebp+1Ch]
|
||||
00000295 FF7518 push dword ptr [ebp+18h]
|
||||
00000298 FF7514 push dword ptr [ebp+14h]
|
||||
0000029B 8B4510 mov eax,[ebp+10h]
|
||||
0000029E 0500000040 add eax,40000000h
|
||||
000002A3 50 push eax
|
||||
000002A4 68EFEBEF00 push 0EFEBEFh
|
||||
000002A9 E852FEFFFF call 100h
|
||||
|
||||
..\lib\kolibri.h-- 435: WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,strlen(text));
|
||||
000002AE 8B7D08 mov edi,[ebp+8]
|
||||
000002B1 E887040000 call 73Dh
|
||||
000002B6 F7D8 neg eax
|
||||
000002B8 B906000000 mov ecx,6
|
||||
000002BD F7E1 mul ecx
|
||||
000002BF 034518 add eax,[ebp+18h]
|
||||
000002C2 83D200 adc edx,0
|
||||
000002C5 0FACD001 shrd eax,edx,1
|
||||
000002C9 034520 add eax,[ebp+20h]
|
||||
000002CC 40 inc eax
|
||||
000002CD 50 push eax
|
||||
000002CE 8B4514 mov eax,[ebp+14h]
|
||||
000002D1 D1E8 shr eax,1
|
||||
000002D3 83E803 sub eax,3
|
||||
000002D6 03451C add eax,[ebp+1Ch]
|
||||
000002D9 50 push eax
|
||||
000002DA 6880000000 push 80h
|
||||
000002DF 6A00 push 0
|
||||
000002E1 FF7508 push dword ptr [ebp+8]
|
||||
000002E4 8B7D08 mov edi,[ebp+8]
|
||||
000002E7 E851040000 call 73Dh
|
||||
000002EC 50 push eax
|
||||
000002ED E838FEFFFF call 12Ah
|
||||
000002F2 5D pop ebp
|
||||
000002F3 C21C00 ret 1Ch
|
||||
|
||||
..\lib\kolibri.h-- 439: void PutImage(dword buf,w,h,x,y)
|
||||
000002F6 C8100000 enter 10h,0
|
||||
|
||||
..\lib\kolibri.h-- 442: EDI=buf;
|
||||
000002FA 8B7D18 mov edi,[ebp+18h]
|
||||
|
||||
..\lib\kolibri.h-- 443: EAX = 7;
|
||||
000002FD 6A07 push 7
|
||||
000002FF 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 444: EBX = buf;
|
||||
00000300 89FB mov ebx,edi
|
||||
|
||||
..\lib\kolibri.h-- 445: ECX = w<<16+h;
|
||||
00000302 8B4D14 mov ecx,[ebp+14h]
|
||||
00000305 C1E110 shl ecx,10h
|
||||
00000308 034D10 add ecx,[ebp+10h]
|
||||
|
||||
..\lib\kolibri.h-- 446: EDX = x<<16+y+skin_width;
|
||||
0000030B 8B550C mov edx,[ebp+0Ch]
|
||||
0000030E C1E210 shl edx,10h
|
||||
00000311 035508 add edx,[ebp+8]
|
||||
00000314 031584070000 add edx,[784h]
|
||||
|
||||
..\lib\kolibri.h-- 447: $int 0x40
|
||||
0000031A CD40 int 40h
|
||||
0000031C C9 leave
|
||||
0000031D C21400 ret 14h
|
||||
|
||||
..\lib\kolibri.h-- 451: void copystr(dword s,d)
|
||||
00000320 55 push ebp
|
||||
00000321 89E5 mov ebp,esp
|
||||
|
||||
..\lib\kolibri.h-- 453: $mov esi,s
|
||||
00000323 8B750C mov esi,[ebp+0Ch]
|
||||
|
||||
..\lib\kolibri.h-- 454: $mov edi,d
|
||||
00000326 8B7D08 mov edi,[ebp+8]
|
||||
|
||||
..\lib\kolibri.h-- 455: $cld
|
||||
00000329 FC cld
|
||||
|
||||
..\lib\kolibri.h-- 457: $lodsb
|
||||
0000032A AC lodsb
|
||||
|
||||
..\lib\kolibri.h-- 458: $stosb
|
||||
0000032B AA stosb
|
||||
|
||||
..\lib\kolibri.h-- 459: $test al,al
|
||||
0000032C 84C0 test al,al
|
||||
|
||||
..\lib\kolibri.h-- 460: $jnz l1
|
||||
0000032E 75FA jne 32Ah
|
||||
00000330 5D pop ebp
|
||||
00000331 C20800 ret 8
|
||||
|
||||
..\lib\kolibri.h-- 464: int pos,razr,backup,j=0,chislo;
|
||||
00000334 00000000 dd 0
|
||||
|
||||
..\lib\kolibri.h-- 465: char buffer[11]="";
|
||||
00000338 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
|
||||
use_library.h-- 2: dword edit_box_draw = #aEdit_box_draw;
|
||||
00000344 5C030000 dd 35Ch
|
||||
|
||||
use_library.h-- 3: dword edit_box_key = #aEdit_box_key;
|
||||
00000348 66030000 dd 366h
|
||||
|
||||
use_library.h-- 4: dword edit_box_mouse = #aEdit_box_mouse;
|
||||
0000034C 74030000 dd 374h
|
||||
|
||||
use_library.h-- 5: dword version_ed = #aVersion_ed;
|
||||
00000350 84030000 dd 384h
|
||||
|
||||
use_library.h-- 28: dword am__ = 0x0;
|
||||
00000354 00000000 dd 0
|
||||
|
||||
use_library.h-- 29: dword bm__ = 0x0;
|
||||
00000358 00000000 dd 0
|
||||
|
||||
use_library.h-- 31: char aEdit_box_draw[9] = "edit_box\0";
|
||||
0000035C 656469745F626F780000 db 'edit_box',0,0
|
||||
|
||||
use_library.h-- 32: char aEdit_box_key[13] = "edit_box_key\0";
|
||||
00000366 656469745F626F785F6B6579 db 'edit_box_key'
|
||||
00000372 0000 db 0,0
|
||||
|
||||
use_library.h-- 33: char aEdit_box_mouse[15] = "edit_box_mouse\0";
|
||||
00000374 656469745F626F785F6D6F75 db 'edit_box_mou'
|
||||
00000380 73650000 db 'se',0,0
|
||||
|
||||
use_library.h-- 34: char aVersion_ed[11] = "version_ed\0";
|
||||
00000384 76657273696F6E5F65640000 db 'version_ed',0,0
|
||||
|
||||
use_library.h-- 36: char aCheck_box_draw [15] = "check_box_draw\0";
|
||||
00000390 636865636B5F626F785F6472 db 'check_box_dr'
|
||||
0000039C 61770000 db 'aw',0,0
|
||||
|
||||
use_library.h-- 37: char aCheck_box_mouse [16] = "check_box_mouse\0";
|
||||
000003A0 636865636B5F626F785F6D6F db 'check_box_mo'
|
||||
000003AC 7573650000 db 'use',0,0
|
||||
|
||||
use_library.h-- 38: char aVersion_ch [11] = "version_ch\0";
|
||||
000003B1 76657273696F6E5F63680000 db 'version_ch',0,0
|
||||
|
||||
use_library.h-- 40: char aOption_box_draw [16] = "option_box_draw\0";
|
||||
000003BD 6F7074696F6E5F626F785F64 db 'option_box_d'
|
||||
000003C9 7261770000 db 'raw',0,0
|
||||
|
||||
use_library.h-- 41: char aOption_box_mouse[17] = "option_box_mouse\0";
|
||||
000003CE 6F7074696F6E5F626F785F6D db 'option_box_m'
|
||||
000003DA 6F7573650000 db 'ouse',0,0
|
||||
|
||||
use_library.h-- 42: char aVersion_op [11] = "version_op\0" ;
|
||||
000003E0 76657273696F6E5F6F700000 db 'version_op',0,0
|
||||
|
||||
use_library.h-- 65: $mov eax,40
|
||||
000003EC B828000000 mov eax,28h
|
||||
|
||||
use_library.h-- 66: $mov ebx,0x27
|
||||
000003F1 BB27000000 mov ebx,27h
|
||||
|
||||
use_library.h-- 67: $int 0x40
|
||||
000003F6 CD40 int 40h
|
||||
|
||||
use_library.h-- 69: $mov eax, 68
|
||||
000003F8 B844000000 mov eax,44h
|
||||
|
||||
use_library.h-- 70: $mov ebx, 19
|
||||
000003FD BB13000000 mov ebx,13h
|
||||
|
||||
use_library.h-- 71: ECX=#way_of_ini;
|
||||
00000402 B946040000 mov ecx,446h
|
||||
|
||||
use_library.h-- 72: $int 0x40
|
||||
00000407 CD40 int 40h
|
||||
|
||||
use_library.h-- 73: $test eax, eax
|
||||
00000409 85C0 test eax,eax
|
||||
|
||||
use_library.h-- 74: $jz exit
|
||||
0000040B 7435 je 442h
|
||||
|
||||
use_library.h-- 77: $mov edx,eax
|
||||
0000040D 89C2 mov edx,eax
|
||||
|
||||
use_library.h-- 78: ESI=#edit_box_draw;
|
||||
0000040F BE44030000 mov esi,344h
|
||||
|
||||
use_library.h-- 80: $lodsd
|
||||
00000414 AD lodsd
|
||||
|
||||
use_library.h-- 81: $test eax,eax
|
||||
00000415 85C0 test eax,eax
|
||||
|
||||
use_library.h-- 82: $jz import_done
|
||||
00000417 7426 je 43Fh
|
||||
|
||||
use_library.h-- 83: $push edx
|
||||
00000419 52 push edx
|
||||
|
||||
use_library.h-- 85: $mov ebx,DSDWORD[EDX]
|
||||
0000041A 8B1A mov ebx,[edx]
|
||||
|
||||
use_library.h-- 86: $test ebx, ebx
|
||||
0000041C 85DB test ebx,ebx
|
||||
|
||||
use_library.h-- 87: $jz exit
|
||||
0000041E 7422 je 442h
|
||||
|
||||
use_library.h-- 88: $push eax
|
||||
00000420 50 push eax
|
||||
|
||||
use_library.h-- 90: $mov cl,DSBYTE[EAX];
|
||||
00000421 8A08 mov cl,[eax]
|
||||
|
||||
use_library.h-- 91: $cmp cl,DSBYTE[EBX];
|
||||
00000423 3A0B cmp cl,[ebx]
|
||||
|
||||
use_library.h-- 92: $jnz import_find_next
|
||||
00000425 7508 jne 42Fh
|
||||
|
||||
use_library.h-- 93: $test cl,cl
|
||||
00000427 84C9 test cl,cl
|
||||
|
||||
use_library.h-- 94: $jz import_found
|
||||
00000429 740A je 435h
|
||||
|
||||
use_library.h-- 95: $inc eax
|
||||
0000042B 40 inc eax
|
||||
|
||||
use_library.h-- 96: $inc ebx
|
||||
0000042C 43 inc ebx
|
||||
|
||||
use_library.h-- 97: $jmp nex1
|
||||
0000042D EBF2 jmp short 421h
|
||||
|
||||
use_library.h-- 99: $pop eax
|
||||
0000042F 58 pop eax
|
||||
|
||||
use_library.h-- 100: $add edx, 8
|
||||
00000430 83C208 add edx,8
|
||||
|
||||
use_library.h-- 101: $jmp import_find
|
||||
00000433 EBE5 jmp short 41Ah
|
||||
|
||||
use_library.h-- 103: $pop eax
|
||||
00000435 58 pop eax
|
||||
|
||||
use_library.h-- 104: $mov eax,DSDWORD[edx+4]
|
||||
00000436 8B4204 mov eax,[edx+4]
|
||||
|
||||
use_library.h-- 105: $mov DSDWORD[esi-4],eax
|
||||
00000439 8946FC mov [esi-4],eax
|
||||
|
||||
use_library.h-- 106: $pop edx
|
||||
0000043C 5A pop edx
|
||||
|
||||
use_library.h-- 107: $jmp import_loop
|
||||
0000043D EBD5 jmp short 414h
|
||||
|
||||
use_library.h-- 109: return 0;
|
||||
0000043F 31C0 xor eax,eax
|
||||
00000441 C3 ret
|
||||
|
||||
use_library.h-- 111: return -1;
|
||||
00000442 83C8FF or eax,0FFFFFFFFh
|
||||
00000445 C3 ret
|
||||
|
||||
EditBox2.c-- 13: char way_of_ini[250] = "/sys/lib/box_lib.obj",NULL; //ᮤ¥à¦¨¬®¥ EditBox'a
|
||||
00000446 2F7379732F6C69622F626F78 db '/sys/lib/box'
|
||||
00000452 5F6C69622E6F626A00000000 db '_lib.obj',0,0,0,0
|
||||
0000045E 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
0000046A 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
00000476 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
00000482 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
0000048E 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
0000049A 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
000004A6 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
000004B2 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
000004BE 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
000004CA 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
000004D6 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
000004E2 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
000004EE 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
000004FA 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
00000506 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
00000512 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
0000051E 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
0000052A 000000000000000000000000 db 0,0,0,0,0,0,0,0,0,0,0,0
|
||||
00000536 00000000000000000000 db 0,0,0,0,0,0,0,0,0,0
|
||||
|
||||
EditBox2.c-- 15: edit_box edit1= {250,14,35,0xffffff,0x6f9480,0,0xAABBCC,0,248,#way_of_ini,2,20,20};
|
||||
00000540 FA0000000E00000023000000 dd 0FAh,0Eh,23h
|
||||
0000054C FFFFFF0080946F0000000000 dd 0FFFFFFh,6F9480h,0
|
||||
00000558 CCBBAA0000000000F8000000 dd 0AABBCCh,0,0F8h
|
||||
00000564 460400000200000014000000 dd 446h,2,14h
|
||||
00000570 140000000000000000000000 dd 14h,0,0
|
||||
0000057C 000000000000000000000000 dd 0,0,0
|
||||
|
||||
EditBox2.c-- 39: void main()
|
||||
00000588 C8040000 enter 4,0
|
||||
|
||||
EditBox2.c-- 42: load_dll();
|
||||
0000058C E85BFEFFFF call 3ECh
|
||||
|
||||
EditBox2.c-- 44: draw_window();
|
||||
00000591 E868000000 call 5FEh
|
||||
|
||||
EditBox2.c-- 47: switch(WaitEvent())
|
||||
00000596 E8B5010000 call 750h
|
||||
0000059B 83F801 cmp eax,1
|
||||
0000059E 0F8441000000 jz 5E5h
|
||||
000005A4 83F802 cmp eax,2
|
||||
000005A7 0F8423000000 jz 5D0h
|
||||
000005AD 83F803 cmp eax,3
|
||||
000005B0 0F8534000000 jnz 5EAh
|
||||
|
||||
EditBox2.c-- 51: id=GetButtonID();
|
||||
000005B6 E8B0010000 call 76Bh
|
||||
000005BB 8845FC mov [ebp-4],al
|
||||
|
||||
EditBox2.c-- 52: IF (id==1) || (id==2) ExitProcess();
|
||||
000005BE 3C01 cmp al,1
|
||||
000005C0 7404 je 5C6h
|
||||
000005C2 3C02 cmp al,2
|
||||
000005C4 7505 jne 5CBh
|
||||
000005C6 E88B010000 call 756h
|
||||
|
||||
EditBox2.c-- 53: break;
|
||||
000005CB E91A000000 jmp 5EAh
|
||||
|
||||
EditBox2.c-- 56: GetKey();
|
||||
000005D0 E887010000 call 75Ch
|
||||
|
||||
EditBox2.c-- 57: edit_box_key stdcall (#edit1);
|
||||
000005D5 6840050000 push 540h
|
||||
000005DA FF1548030000 call dword ptr [348h]
|
||||
|
||||
EditBox2.c-- 58: break;
|
||||
000005E0 E905000000 jmp 5EAh
|
||||
|
||||
EditBox2.c-- 60: case evReDraw: draw_window(); break;
|
||||
000005E5 E814000000 call 5FEh
|
||||
|
||||
EditBox2.c-- 65: edit_box_mouse stdcall (#edit1);
|
||||
000005EA 6840050000 push 540h
|
||||
000005EF FF154C030000 call dword ptr [34Ch]
|
||||
000005F5 EB9F jmp short 596h
|
||||
|
||||
EditBox2.c-- 69: ExitProcess();
|
||||
000005F7 E85A010000 call 756h
|
||||
000005FC C9 leave
|
||||
000005FD C3 ret
|
||||
|
||||
EditBox2.c-- 74: WindowRedrawStatus(1);
|
||||
000005FE 6A01 push 1
|
||||
00000600 E89CFAFFFF call 0A1h
|
||||
|
||||
EditBox2.c-- 75: skin_width = GetSkinWidth();
|
||||
00000605 E858010000 call 762h
|
||||
0000060A A384070000 mov [784h],eax
|
||||
|
||||
EditBox2.c-- 76: DefineAndDrawWindow(400,200,280,200,0x04,0x00E4DFE1,0,0,0); DrawTitle("Extended EditBox in C--");
|
||||
0000060F 6890010000 push 190h
|
||||
00000614 68C8000000 push 0C8h
|
||||
00000619 6818010000 push 118h
|
||||
0000061E 68C8000000 push 0C8h
|
||||
00000623 6A04 push 4
|
||||
00000625 68E1DFE400 push 0E4DFE1h
|
||||
0000062A 6A00 push 0
|
||||
0000062C 6A00 push 0
|
||||
0000062E 6A00 push 0
|
||||
00000630 E87BFAFFFF call 0B0h
|
||||
00000635 B9BA060000 mov ecx,6BAh
|
||||
0000063A E83B010000 call 77Ah
|
||||
|
||||
EditBox2.c-- 77: Form.getme();
|
||||
0000063F 68E6090000 push 9E6h
|
||||
00000644 E846FAFFFF call 8Fh
|
||||
|
||||
EditBox2.c-- 79: WriteText(30,40,0x80,0,"<22> ¨¯à®á⥩訩 ¯à¨¬¥à EditBox'a ‘--",0);
|
||||
00000649 6A1E push 1Eh
|
||||
0000064B 6A28 push 28h
|
||||
0000064D 6880000000 push 80h
|
||||
00000652 6A00 push 0
|
||||
00000654 68D2060000 push 6D2h
|
||||
00000659 6A00 push 0
|
||||
0000065B E8CAFAFFFF call 12Ah
|
||||
|
||||
EditBox2.c-- 80: WriteText(30,50,0x80,0,"<22>® ¥£® ¬®¦® ¥¬®£® ãá«®¦¨âì á 楫ìî",0);
|
||||
00000660 6A1E push 1Eh
|
||||
00000662 6A32 push 32h
|
||||
00000664 6880000000 push 80h
|
||||
00000669 6A00 push 0
|
||||
0000066B 68F8060000 push 6F8h
|
||||
00000670 6A00 push 0
|
||||
00000672 E8B3FAFFFF call 12Ah
|
||||
|
||||
EditBox2.c-- 81: WriteText(30,60,0x80,0,"㬥ìè¥¨ï ¯¥à¥à¨á®¢ª¨.",0);
|
||||
00000677 6A1E push 1Eh
|
||||
00000679 6A3C push 3Ch
|
||||
0000067B 6880000000 push 80h
|
||||
00000680 6A00 push 0
|
||||
00000682 681F070000 push 71Fh
|
||||
00000687 6A00 push 0
|
||||
00000689 E89CFAFFFF call 12Ah
|
||||
|
||||
EditBox2.c-- 83: DrawFlatButton(100,105,70,22,2,0xD7D7D7,"Close");
|
||||
0000068E 6A64 push 64h
|
||||
00000690 6A69 push 69h
|
||||
00000692 6A46 push 46h
|
||||
00000694 6A16 push 16h
|
||||
00000696 6A02 push 2
|
||||
00000698 68D7D7D700 push 0D7D7D7h
|
||||
0000069D 6837070000 push 737h
|
||||
000006A2 E832FBFFFF call 1D9h
|
||||
|
||||
EditBox2.c-- 88: edit_box_draw stdcall (#edit1);
|
||||
000006A7 6840050000 push 540h
|
||||
000006AC FF1544030000 call dword ptr [344h]
|
||||
|
||||
EditBox2.c-- 92: WindowRedrawStatus(2);
|
||||
000006B2 6A02 push 2
|
||||
000006B4 E8E8F9FFFF call 0A1h
|
||||
000006B9 C3 ret
|
||||
|
||||
000006BA 457874656E64656420456469 db 'Extended Edi'
|
||||
000006C6 74426F7820696E20432D2D00 db 'tBox in C--',0
|
||||
000006D2 8DA0A8AFE0AEE1E2A5A9E8A8 db '<27> ¨¯à®á⥩è¨'
|
||||
000006DE A920AFE0A8ACA5E020456469 db '© ¯à¨¬¥à Edi'
|
||||
000006EA 74426F78276120ADA020912D db 'tBox'a ‘-'
|
||||
000006F6 2D008DAE20A5A3AE20ACAEA6 db '-',0,'<27>® ¥£® ¬®¦'
|
||||
00000702 ADAE20ADA5ACADAEA3AE20E3 db '® ¥¬®£® ã'
|
||||
0000070E E1ABAEA6ADA8E2EC20E120E6 db 'á«®¦¨âì á æ'
|
||||
0000071A A5ABECEE00E3ACA5ADECE8A5 db '¥«ìî',0,'㬥ìè¥'
|
||||
00000726 ADA8EF20AFA5E0A5E0A8E1AE db '¨ï ¯¥à¥à¨á®'
|
||||
00000732 A2AAA82E00436C6F736500 db '¢ª¨.',0,'Close',0
|
||||
|
||||
..\lib\kolibri.h-- 287: ECX=0;
|
||||
0000073D 31C9 xor ecx,ecx
|
||||
|
||||
..\lib\kolibri.h-- 288: EAX=0;
|
||||
0000073F 89C8 mov eax,ecx
|
||||
|
||||
..\lib\kolibri.h-- 289: ECX--;
|
||||
00000741 49 dec ecx
|
||||
|
||||
..\lib\kolibri.h-- 290: $REPNE $SCASB
|
||||
00000742 F2AE repne scasb
|
||||
|
||||
..\lib\kolibri.h-- 291: EAX=EAX-2-ECX;
|
||||
00000744 83E802 sub eax,2
|
||||
00000747 29C8 sub eax,ecx
|
||||
00000749 C3 ret
|
||||
|
||||
..\lib\kolibri.h-- 215: EAX = 13;
|
||||
0000074A 6A0D push 0Dh
|
||||
0000074C 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 216: $int 0x40
|
||||
0000074D CD40 int 40h
|
||||
|
||||
..\lib\kolibri.h-- 217: #codesize
|
||||
0000074F C3 ret
|
||||
|
||||
..\lib\kolibri.h-- 156: EAX = 10; // wait here for event
|
||||
00000750 6A0A push 0Ah
|
||||
00000752 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 157: $int 0x40
|
||||
00000753 CD40 int 40h
|
||||
00000755 C3 ret
|
||||
|
||||
..\lib\kolibri.h-- 161: EAX = -1; // close this program
|
||||
00000756 83C8FF or eax,0FFFFFFFFh
|
||||
|
||||
..\lib\kolibri.h-- 162: $int 0x40
|
||||
00000759 CD40 int 40h
|
||||
0000075B C3 ret
|
||||
|
||||
..\lib\kolibri.h-- 172: EAX = 2; // just read this key from buffer
|
||||
0000075C 6A02 push 2
|
||||
0000075E 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 173: $int 0x40
|
||||
0000075F CD40 int 40h
|
||||
00000761 C3 ret
|
||||
|
||||
..\lib\kolibri.h-- 249: EAX = 48;
|
||||
00000762 6A30 push 30h
|
||||
00000764 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 250: EBX = 4;
|
||||
00000765 6A04 push 4
|
||||
00000767 5B pop ebx
|
||||
|
||||
..\lib\kolibri.h-- 251: $int 0x40
|
||||
00000768 CD40 int 40h
|
||||
0000076A C3 ret
|
||||
|
||||
..\lib\kolibri.h-- 184: EAX = 17; // Get ID
|
||||
0000076B 6A11 push 11h
|
||||
0000076D 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 185: $int 0x40
|
||||
0000076E CD40 int 40h
|
||||
|
||||
..\lib\kolibri.h-- 186: EAX = EAX >> 8;
|
||||
00000770 C1E808 shr eax,8
|
||||
00000773 C3 ret
|
||||
|
||||
..\lib\kolibri.h-- 151: EAX = 8;
|
||||
00000774 6A08 push 8
|
||||
00000776 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 152: $int 0x40
|
||||
00000777 CD40 int 40h
|
||||
00000779 C3 ret
|
||||
|
||||
..\lib\kolibri.h-- 242: EAX = 71;
|
||||
0000077A 6A47 push 47h
|
||||
0000077C 58 pop eax
|
||||
|
||||
..\lib\kolibri.h-- 243: EBX = 1;
|
||||
0000077D 31DB xor ebx,ebx
|
||||
0000077F 43 inc ebx
|
||||
|
||||
..\lib\kolibri.h-- 244: $int 0x40;
|
||||
00000780 CD40 int 40h
|
||||
00000782 C3 ret
|
5
programs/develop/libraries/box_lib/C--/trunk/compile.bat
Normal file
5
programs/develop/libraries/box_lib/C--/trunk/compile.bat
Normal file
@ -0,0 +1,5 @@
|
||||
C-- EditBox2.c--
|
||||
del EditBox2.kex
|
||||
rename EditBox2 EditBox2.kex
|
||||
rename EditBox2.com EditBox2.kex
|
||||
pause
|
112
programs/develop/libraries/box_lib/C--/trunk/use_library.h--
Normal file
112
programs/develop/libraries/box_lib/C--/trunk/use_library.h--
Normal file
@ -0,0 +1,112 @@
|
||||
//BOX_LIB
|
||||
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
|
||||
//dword
|
||||
//dword
|
||||
|
||||
//dword
|
||||
//dword
|
||||
//dword
|
||||
|
||||
//$edit_box_draw dword aEdit_box_draw
|
||||
//$edit_box_key dword aEdit_box_key
|
||||
//$edit_box_mouse dword aEdit_box_mouse
|
||||
//$version_ed dword aVersion_ed
|
||||
|
||||
//$check_box_draw dword aCheck_box_draw
|
||||
//$check_box_mouse dword aCheck_box_mouse
|
||||
//$version_ch dword aVersion_ch
|
||||
|
||||
//$option_box_draw dword aOption_box_draw
|
||||
//$option_box_mouse dword aOption_box_mouse
|
||||
//$version_op dword aVersion_op
|
||||
|
||||
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 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, flags, size, pos, offset, cl_curs_x, cl_curs_y, shift, shift_old;
|
||||
};
|
||||
|
||||
//void Edit_box_draw(dword edit_b)
|
||||
//{
|
||||
|
||||
// $ PUSH dword edit_b
|
||||
// $ CALL dword [edit_box_draw]
|
||||
//}
|
||||
|
||||
//struct load_dll{
|
||||
// dword way_of_ini, myimport;
|
||||
// void get();
|
||||
//};
|
||||
|
||||
int load_dll(EAX)
|
||||
{
|
||||
//set mask
|
||||
$mov eax,40
|
||||
$mov ebx,0x27
|
||||
$int 0x40
|
||||
// load DLL
|
||||
$mov eax, 68
|
||||
$mov ebx, 19
|
||||
ECX=#way_of_ini;
|
||||
$int 0x40
|
||||
$test eax, eax
|
||||
$jz exit
|
||||
|
||||
// initialize import
|
||||
$mov edx,eax
|
||||
ESI=#edit_box_draw;
|
||||
import_loop:
|
||||
$lodsd
|
||||
$test eax,eax
|
||||
$jz import_done
|
||||
$push edx
|
||||
import_find:
|
||||
$mov ebx,DSDWORD[EDX]
|
||||
$test ebx, ebx
|
||||
$jz exit
|
||||
$push eax
|
||||
nex1:
|
||||
$mov cl,DSBYTE[EAX];
|
||||
$cmp cl,DSBYTE[EBX];
|
||||
$jnz import_find_next
|
||||
$test cl,cl
|
||||
$jz import_found
|
||||
$inc eax
|
||||
$inc ebx
|
||||
$jmp nex1
|
||||
import_find_next:
|
||||
$pop eax
|
||||
$add edx, 8
|
||||
$jmp import_find
|
||||
import_found:
|
||||
$pop eax
|
||||
$mov eax,DSDWORD[edx+4]
|
||||
$mov DSDWORD[esi-4],eax
|
||||
$pop edx
|
||||
$jmp import_loop
|
||||
import_done:
|
||||
return 0;
|
||||
exit:
|
||||
return -1;
|
||||
}
|
50
programs/develop/libraries/box_lib/C--/trunk/warning.txt
Normal file
50
programs/develop/libraries/box_lib/C--/trunk/warning.txt
Normal file
@ -0,0 +1,50 @@
|
||||
..\lib\kolibri.h--(43)> Warning! ECX has been used by compiler.
|
||||
..\lib\kolibri.h--(63)> Warning! ESI has been used by compiler.
|
||||
..\lib\kolibri.h--(64)> Warning! Register ESI already initialized.
|
||||
..\lib\kolibri.h--(72)> Warning! ESI has been used by compiler.
|
||||
..\lib\kolibri.h--(73)> Warning! Register ESI already initialized.
|
||||
..\lib\kolibri.h--(126)> Warning! EBX has been used by compiler.
|
||||
..\lib\kolibri.h--(435)> Warning! Expansion variable.
|
||||
..\lib\kolibri.h--(435)> Warning! ECX has been used by compiler.
|
||||
..\lib\kolibri.h--(444)> Warning! Register EBX same as EDI.
|
||||
..\lib\kolibri.h--(439)> Warning! Local variable 'i' possible not used.
|
||||
..\lib\kolibri.h--(439)> Warning! Local variable 'r' possible not used.
|
||||
..\lib\kolibri.h--(439)> Warning! Local variable 'g' possible not used.
|
||||
..\lib\kolibri.h--(439)> Warning! Local variable 'b' possible not used.
|
||||
EditBox2.c--(42)> Warning! Missing parameter in function .
|
||||
EditBox2.c--(52)> Warning! Register AL already initialized.
|
||||
EditBox2.c--(52)> Warning! Register AL already initialized.
|
||||
EditBox2.c--(55)> Warning! Short operator 'CASE' may be used.
|
||||
EditBox2.c--(60)> Warning! Short operator 'CASE' may be used.
|
||||
EditBox2.c--(47)> Warning! Short operator 'SWITCH' may be used.
|
||||
EditBox2.c--(53)> Warning! Short operator 'BREAK' may be used.
|
||||
EditBox2.c--(58)> Warning! Short operator 'BREAK' may be used.
|
||||
..\lib\kolibri.h--(288)> Warning! Register EAX same as ECX.
|
||||
..\lib\kolibri.h--(4)> Warning! Variable 'os_name' possible not used.
|
||||
..\lib\kolibri.h--(5)> Warning! Variable 'os_version' possible not used.
|
||||
..\lib\kolibri.h--(6)> Warning! Variable 'start_addr' possible not used.
|
||||
..\lib\kolibri.h--(9)> Warning! Variable 'x86esp_reg' possible not used.
|
||||
use_library.h--(5)> Warning! Variable 'version_ed' possible not used.
|
||||
..\lib\kolibri.h--(464)> Warning! Variable 'pos' possible not used.
|
||||
..\lib\kolibri.h--(464)> Warning! Variable 'razr' possible not used.
|
||||
..\lib\kolibri.h--(7)> Warning! Variable 'final_addr' possible not used.
|
||||
..\lib\kolibri.h--(464)> Warning! Variable 'j' possible not used.
|
||||
..\lib\kolibri.h--(8)> Warning! Variable 'alloc_mem' possible not used.
|
||||
..\lib\kolibri.h--(451)> Warning! Function 'copystr' possible not used.
|
||||
..\lib\kolibri.h--(464)> Warning! Variable 'backup' possible not used.
|
||||
..\lib\kolibri.h--(464)> Warning! Variable 'chislo' possible not used.
|
||||
..\lib\kolibri.h--(465)> Warning! Variable 'buffer' possible not used.
|
||||
use_library.h--(29)> Warning! Variable 'bm__' possible not used.
|
||||
use_library.h--(28)> Warning! Variable 'am__' possible not used.
|
||||
use_library.h--(42)> Warning! Variable 'aVersion_op' possible not used.
|
||||
use_library.h--(38)> Warning! Variable 'aVersion_ch' possible not used.
|
||||
use_library.h--(40)> Warning! Variable 'aOption_box_draw' possible not used.
|
||||
use_library.h--(41)> Warning! Variable 'aOption_box_mouse' possible not used.
|
||||
use_library.h--(36)> Warning! Variable 'aCheck_box_draw' possible not used.
|
||||
use_library.h--(37)> Warning! Variable 'aCheck_box_mouse' possible not used.
|
||||
..\lib\kolibri.h--(10)> Warning! Variable 'I_Param' possible not used.
|
||||
..\lib\kolibri.h--(439)> Warning! Function 'PutImage' possible not used.
|
||||
EditBox2.c--(13)> Warning! Variable 'NULL' possible not used.
|
||||
..\lib\kolibri.h--(11)> Warning! Variable 'I_Icon' possible not used.
|
||||
..\lib\kolibri.h--(510)> Warning! Structure 'CopyFile_f' possible not used.
|
||||
..\lib\kolibri.h--(511)> Warning! Structure 'CopyFile_atr' possible not used.
|
67
programs/develop/libraries/box_lib/trunk/box_lib.asm
Normal file
67
programs/develop/libraries/box_lib/trunk/box_lib.asm
Normal file
@ -0,0 +1,67 @@
|
||||
;Libray from Editbox
|
||||
; SEE YOU File FAQ.txt and HISTORY. Good Like!
|
||||
;Last Change 13/02/2009
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
|
||||
format MS COFF
|
||||
|
||||
public EXPORTS
|
||||
|
||||
section '.flat' code readable align 16
|
||||
include 'macros.inc'
|
||||
include 'editbox.mac' ;¬ ªà®á ª®â®àë© ¤®«¦¥ ®¡«¥£ç¨âì ¦¨§ì :) á¯¥æ¨ «ì® ¤«ï editbox
|
||||
include 'checkbox.mac' ;¬ ªà®á ᮤ¥à¦¨â ॠ«¨§ æ¨î checkbox
|
||||
include 'optionbox.mac' ;¬ ªà®á ᮤ¥à¦¨â ॠ«¨§ æ¨î optionbox
|
||||
;----------------------------------------------------
|
||||
;EditBox
|
||||
;----------------------------------------------------
|
||||
|
||||
use_editbox_draw ;¬ ªà®á à ááªàë¢ ¥â äãªæ¨î ®â®¡à ¦¥¨ï ¡®ªá .
|
||||
use_editbox_key ;¬ ªà®á à ááªàë¢ ¥â äãªæ¨î ®¡à ¡®âª¨ ª« ¢¨èì.
|
||||
use_editbox_mouse ;¬ ªà®á à ááªàë¢ ¥â äãªæ¨î ®¡à ¡®âª¨ ¬ëè¨.
|
||||
|
||||
;----------------------------------------------------
|
||||
;CheckBox
|
||||
;----------------------------------------------------
|
||||
use_checkbox_draw ;¬ ªà®á à ááªàë¢ ¥â äãªæ¨î ®â®¡à ¦¥¨ï ¡®ªá .
|
||||
use_checkbox_mouse ;¬ ªà®á à ááªàë¢ ¥â äãªæ¨î ®¡à ¡®âª¨ ¬ëè¨.
|
||||
|
||||
|
||||
;--------------------------------------------------
|
||||
;radiobutton Group
|
||||
;--------------------------------------------------
|
||||
use_optionbox_driver ;¬ ªà®áë ª®â®àë¥ ã¯à ¢«ïîâ à ¡®â®© ¡®ªá )
|
||||
use_optionbox_draw ;¬ ªà®á à ááªàë¢ ¥â äãªæ¨î ®â®¡à ¦¥¨ï ¡®ªá .
|
||||
use_optionbox_mouse ;¬ ªà®á à ááªàë¢ ¥â äãªæ¨î ®¡à ¡®âª¨ ¬ëè¨.
|
||||
|
||||
align 16
|
||||
EXPORTS:
|
||||
|
||||
dd sz_edit_box, edit_box
|
||||
dd sz_edit_box_key, edit_box_key
|
||||
dd sz_edit_box_mouse, edit_box_mouse
|
||||
dd szVersion_ed, 0x00000001
|
||||
dd sz_check_box_draw, check_box_draw
|
||||
dd sz_check_box_mouse, check_box_mouse
|
||||
dd szVersion_ch, 0x00000001
|
||||
dd sz_option_box_draw, option_box_draw
|
||||
dd sz_option_box_mouse, option_box_mouse
|
||||
dd szVersion_op, 0x00000001
|
||||
dd 0,0
|
||||
|
||||
sz_edit_box db 'edit_box',0
|
||||
sz_edit_box_key db 'edit_box_key',0
|
||||
sz_edit_box_mouse db 'edit_box_mouse',0
|
||||
szVersion_ed db 'version_ed',0
|
||||
sz_check_box_draw db 'check_box_draw',0
|
||||
sz_check_box_mouse db 'check_box_mouse',0
|
||||
szVersion_ch db 'version_ch',0
|
||||
sz_option_box_draw db 'option_box_draw',0
|
||||
sz_option_box_mouse db 'option_box_mouse',0
|
||||
szVersion_op db 'version_op',0
|
||||
|
||||
;;;;;;;;;;;
|
||||
;;Data
|
||||
;;;;;;;;;;;
|
||||
align 16
|
||||
mouse_flag dd 0x0
|
148
programs/develop/libraries/box_lib/trunk/checkbox.mac
Normal file
148
programs/develop/libraries/box_lib/trunk/checkbox.mac
Normal file
@ -0,0 +1,148 @@
|
||||
;файл создан 13.02.2009 <Lrz> На код применена GPL2 лицензия
|
||||
;Макрос для системной библиотеки box_lib.obj
|
||||
;Checkbox
|
||||
|
||||
macro use_checkbox_draw
|
||||
{
|
||||
check_box_draw:
|
||||
;ch_struc_size=24
|
||||
ch_left equ [edi] ;координата начала рисования по х
|
||||
ch_top equ [edi+2] ;координата начала рисования по у
|
||||
ch_text_margin equ [edi+4] ;=4 расстояние от прямоугольника чек бокса до надписи
|
||||
ch_size equ [edi+8] ;12 размер квадрата чек бокса
|
||||
ch_color equ [edi+12]
|
||||
ch_border_color equ [edi+16] ; or [edi+4] ;цвет рамки checkbox ее можно задать самостоятельно
|
||||
ch_text_color equ [edi+20];[edi+4] ;цвет текста
|
||||
ch_text_ptr equ [edi+24] ;указатель на начало текстовой строки
|
||||
ch_text_length equ [edi+28]
|
||||
ch_flags equ [edi+32] ;флаги
|
||||
|
||||
pusha ;сохраним все регистры
|
||||
mov edi,dword [esp+36]
|
||||
mov eax,13
|
||||
movzx ebx,word ch_left
|
||||
shl ebx,16
|
||||
add ebx,ch_size
|
||||
mov ecx,ch_top
|
||||
shl ecx,16
|
||||
add ecx,dword ch_size
|
||||
mov edx,dword ch_border_color
|
||||
mcall ;рисуем рамку
|
||||
|
||||
mov edx,dword ch_color
|
||||
add ebx,1 shl 16 - 2
|
||||
add ecx,1 shl 16 - 2
|
||||
mcall ;закрашиваем внутренности чекбокса
|
||||
|
||||
test dword ch_flags,2 ;достать значение бита из переменной и поместить в флаг CF
|
||||
jz @f ;в если CF=1, то выполним следующую процедуру иначе перейти на нижнюю @@
|
||||
call check_box_draw_ch ;нарисовать включенный чек бокс
|
||||
@@:
|
||||
;----------------------------
|
||||
;расчет куда будет произведен вывод текста
|
||||
;----------------------------
|
||||
movzx ebx,word ch_left ;загрузить значение х для чек бокса
|
||||
add ebx,dword ch_size
|
||||
add ebx,dword ch_text_margin;добавить размер стороны и расстояние на котором начнется вывод текста
|
||||
shl ebx,16 ;сдвинем на 16 разрядов в лево (умножим на 65536)
|
||||
mov bx,word ch_top ;загрузим значение по y
|
||||
add ebx,ch_size
|
||||
mov ecx,dword ch_text_color ;загрузим цвет надписи + flags
|
||||
sub ebx,7 ;добавим значение длины стороны -9+2
|
||||
|
||||
mov edx,dword ch_text_ptr ;укажем адрес от куда нужно выводить строку
|
||||
mov esi,dword ch_text_length
|
||||
;внесем в eax значение вывода надписи на канву
|
||||
mov eax,4
|
||||
mcall ;Вывод
|
||||
popa ;восстановить значения регистров из стека
|
||||
ret 4 ;выйдем из процедуры
|
||||
|
||||
check_box_clear_ch: ;очистка чек бокса
|
||||
mov edx,dword ch_color ;цвет внутри чек бокса
|
||||
jmp @f ;безусловный прыжок на нижнюю метку @@
|
||||
check_box_draw_ch: ;нарисовать включенный чек бокс
|
||||
mov edx,dword ch_border_color ;загрузить цвет
|
||||
@@:
|
||||
movzx ebx,word ch_left ;загрузить координату по х
|
||||
mov eax,dword ch_size
|
||||
push ax
|
||||
shr eax,2
|
||||
add ebx,eax ;добавить (сторона прямоугольника/3)
|
||||
shl ebx,16 ;сдвинем на 16 разрядов в лево (умножим на 65536)
|
||||
pop bx
|
||||
shr bx,1 ;загрузить (сторона прямоугольника/2)
|
||||
mov bp,bx ;сохраним регистр bx в регистре указателя базы
|
||||
|
||||
movzx ecx,word ch_top ;загрузить координату по у
|
||||
mov eax,dword ch_size
|
||||
shr eax,2
|
||||
add ecx,eax ;добавить (сторона прямоугольника/4)
|
||||
shl ecx,16 ;сдвинем на 16 разрядов в лево (умножим на 65536)
|
||||
mov cx,bp ;загрузим значения регистра указателя базы в cx
|
||||
mov eax,13 ;в eax - значения функции для вывода полосы т.е. по сути прямоугольника, который отображает включенный компонент чек бокс
|
||||
mcall ;вывод
|
||||
ret ;выйти из процедуры
|
||||
}
|
||||
|
||||
|
||||
macro use_checkbox_mouse
|
||||
{
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;Обработчик mouse
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
check_box_mouse: ;обработка мыши
|
||||
pusha
|
||||
mov edi,dword [esp+36]
|
||||
mov eax,37 ;будем что то делать если у нас что - нить нажато
|
||||
mov ebx,2 ;внести в регистр значение 2
|
||||
mcall ;проверка не нажал ли пользователь кнопку мышки
|
||||
test eax,eax ;проверка если у нас в eax=0, то установим флаг и выйдем
|
||||
jnz @f ;перейти на нижнюю метку @@
|
||||
btr dword ch_flags,2 ;извлечение значения заданного бита в флаг cf и изменение его значения на нулевое.
|
||||
jmp check_box_mouse_end
|
||||
|
||||
@@:
|
||||
bts dword ch_flags,2 ;проверка флага т.е. перенос в cf значение бита и установка бита в состояние включено
|
||||
jc check_box_mouse_end ;если CF=1 то перейти в конец т.е. это выход
|
||||
mov esi,dword ch_text_length ;загрузить кол-во символов в текстовой строке
|
||||
;Умножение на 6 Быстрое умножение можно воспользоваться любым мз методов, но на старых Процессорах (386,486,P1)быстрее будет с инструкцией Lea
|
||||
;lea esi,[eax*2+eax]
|
||||
;shl eax,1
|
||||
imul esi,6 ; или можно и так умножить на 6
|
||||
add esi,dword ch_text_margin ;добавить 3 - расстояние от чек бокса до надписи
|
||||
|
||||
mov eax,37 ;получим координаты мышки
|
||||
mov ebx,1 ;добавить 1
|
||||
mcall ;получить координаты курсора относительно окна
|
||||
|
||||
movzx ebx,word ch_top ;загрузить в bx значение координаты у
|
||||
cmp ax,bx ;сравнить с с координатой курсора
|
||||
jl check_box_mouse_end ;SF <> OF если меньше
|
||||
add ebx,dword ch_size ;добавить размер
|
||||
cmp ax,bx ;сравнить
|
||||
jg check_box_mouse_end ;ZF = 0 и SF = OF если больше
|
||||
|
||||
shr eax,16 ;разделим на 65536 или просто сдвинем биты на 16 значений
|
||||
movzx ebx,word ch_left ;произведем аналогичное сравнение
|
||||
cmp ax,bx ;сравнить регистры
|
||||
jl check_box_mouse_end ;если меньше
|
||||
add ebx,dword ch_size ;добавить длину стороны прямоугольника
|
||||
add ebx,esi ;Учесть в значении по х еще и длину надписи к чекбоксу
|
||||
cmp ax,bx ;стравнить регистры
|
||||
jg check_box_mouse_end ;если больше
|
||||
|
||||
bts dword ch_flags,1 ;извлечение значения заданного бита в флаг cf и изменение его значения на 1.
|
||||
jc @f ;CF=1 то перейти на нижнюю @@
|
||||
|
||||
call check_box_draw_ch ;отобразить включенный чек бокс
|
||||
; mov dword [esp+24],1 ;дальнейшая проверка чек боксов бесмыслена, по этому в стек, где располагается ecx поместитм 0
|
||||
jmp check_box_mouse_end ;выйти
|
||||
@@:
|
||||
btr word ch_flags,1 ;извлечение значения заданного бита в флаг cf и изменение его значения на нулевое.
|
||||
call check_box_clear_ch ;выключить чек бокс т.е. на месте закрашенного прямоугольника отобразить цвет фона.
|
||||
check_box_mouse_end:
|
||||
popa ;восстановить регистры из стека
|
||||
ret 4 ;выйти
|
||||
}
|
1
programs/develop/libraries/box_lib/trunk/config.inc
Normal file
1
programs/develop/libraries/box_lib/trunk/config.inc
Normal file
@ -0,0 +1 @@
|
||||
__CPU_type fix p5
|
1397
programs/develop/libraries/box_lib/trunk/editbox.mac
Normal file
1397
programs/develop/libraries/box_lib/trunk/editbox.mac
Normal file
File diff suppressed because it is too large
Load Diff
245
programs/develop/libraries/box_lib/trunk/editbox_ex.asm
Normal file
245
programs/develop/libraries/box_lib/trunk/editbox_ex.asm
Normal file
@ -0,0 +1,245 @@
|
||||
;§ £®«®¢®ª ¯à¨«®¦¥¨ï
|
||||
use32 ; âà á«ïâ®à, ¨á¯®«ì§ãî騩 32 à §àï¤ëå ª®¬ ¤ë
|
||||
org 0x0 ; ¡ §®¢ë© ¤à¥á ª®¤ , ¢á¥£¤ 0x0
|
||||
db 'MENUET01' ; ¨¤¥â¨ä¨ª â®à ¨á¯®«ï¥¬®£® ä ©« (8 ¡ ©â)
|
||||
dd 0x1 ; ¢¥àá¨ï ä®à¬ â § £®«®¢ª ¨á¯®«ï¥¬®£® ä ©«
|
||||
dd start ; ¤à¥á, ª®â®àë© á¨á⥬ ¯¥à¥¤ ñâ ã¯à ¢«¥¨¥
|
||||
; ¯®á«¥ § £à㧪¨ ¯à¨«®¦¥¨ï ¢ ¯ ¬ïâì
|
||||
dd i_end ; à §¬¥à ¯à¨«®¦¥¨ï
|
||||
dd mem ; Ž¡ê¥¬ ¨á¯®«ì§ã¥¬®© ¯ ¬ïâ¨, ¤«ï á⥪ ®â¢¥¤¥¬ 0å100 ¡ ©â ¨ ¢ë஢¨¬ £à¨æã 4 ¡ ©â
|
||||
dd mem ; à ᯮ«®¦¨¬ ¯®§¨æ¨î á⥪ ¢ ®¡« á⨠¯ ¬ïâ¨, áà §ã § ⥫®¬ ¯à®£à ¬¬ë. ‚¥àè¨ á⥪ ¢ ¤¨ ¯ §®¥ ¯ ¬ïâ¨, 㪠§ ®¬ ¢ëè¥
|
||||
dd 0x0 ; 㪠§ ⥫ì áâபã á ¯ à ¬¥âà ¬¨.
|
||||
dd way_of_ini
|
||||
include 'macros.inc'
|
||||
include 'editbox_ex.mac'
|
||||
start:
|
||||
;Get way for ini file.
|
||||
mov edi,way_of_ini
|
||||
mov ecx,1024
|
||||
xor eax,eax
|
||||
cld
|
||||
repne scasb
|
||||
test ecx,ecx
|
||||
jz @f
|
||||
|
||||
mov esi,1024
|
||||
sub esi,ecx
|
||||
mov ecx,esi
|
||||
std
|
||||
mov al,'/'
|
||||
repne scasb
|
||||
test ecx,ecx
|
||||
jz next_way
|
||||
add edi,2
|
||||
@@:
|
||||
mov esi,ini_file
|
||||
cld
|
||||
|
||||
@@: lodsb
|
||||
test al,al
|
||||
jz @f
|
||||
stosb
|
||||
jmp @b
|
||||
|
||||
@@: xor eax,eax
|
||||
stosb
|
||||
|
||||
; load DLL
|
||||
mov ecx,way_of_ini
|
||||
mov eax, 68
|
||||
mov ebx, 19
|
||||
mcall
|
||||
test eax, eax
|
||||
jz next_way
|
||||
jmp import_init_
|
||||
next_way:
|
||||
mov ecx,ini_file
|
||||
mov eax, 68
|
||||
mov ebx, 19
|
||||
mcall
|
||||
test eax, eax
|
||||
jz exit
|
||||
|
||||
|
||||
|
||||
import_init_:
|
||||
; initialize import
|
||||
mov edx, eax
|
||||
mov esi,myimport
|
||||
import_loop:
|
||||
lodsd
|
||||
test eax, eax
|
||||
jz import_done
|
||||
push edx
|
||||
import_find:
|
||||
mov ebx, [edx]
|
||||
test ebx, ebx
|
||||
jz exit;import_not_found
|
||||
push eax
|
||||
@@:
|
||||
mov cl, [eax]
|
||||
cmp cl, [ebx]
|
||||
jnz import_find_next
|
||||
test cl, cl
|
||||
jz import_found
|
||||
inc eax
|
||||
inc ebx
|
||||
jmp @b
|
||||
import_find_next:
|
||||
pop eax
|
||||
add edx, 8
|
||||
jmp import_find
|
||||
import_found:
|
||||
pop eax
|
||||
mov eax, [edx+4]
|
||||
mov [esi-4], eax
|
||||
pop edx
|
||||
jmp import_loop
|
||||
import_done:
|
||||
|
||||
mcall 40,0x27 ;ãáâ ®¢¨âì ¬ áªã ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩
|
||||
red_win:
|
||||
call draw_window ;¯¥à¢® ç «ì® ¥®¡å®¤¨¬® à¨á®¢ âì ®ª®
|
||||
align 4
|
||||
still: ;®á®¢®© ®¡à ¡®â稪
|
||||
mcall 10 ;Ž¦¨¤ âì ᮡëâ¨ï
|
||||
dec eax
|
||||
jz red_win
|
||||
dec eax
|
||||
jz key
|
||||
dec eax
|
||||
jz button
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_mouse]
|
||||
|
||||
push dword edit2
|
||||
call [edit_box_mouse]
|
||||
|
||||
push dword check1
|
||||
call [check_box_mouse]
|
||||
|
||||
push dword check2
|
||||
call [check_box_mouse]
|
||||
|
||||
push dword Option_boxs
|
||||
call [option_box_mouse]
|
||||
|
||||
push dword Option_boxs2
|
||||
call [option_box_mouse]
|
||||
|
||||
jmp still ;¥á«¨ ¨ç¥£® ¨§ ¯¥à¥ç¨á«¥®£® ⮠ᮢ ¢ 横«
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
button:
|
||||
mcall 17 ;¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª« ¢¨è¨
|
||||
test ah,ah ;¥á«¨ ¢ ah 0, â® ¯¥à¥©â¨ ®¡à ¡®â稪 ᮡë⨩ still
|
||||
jz still
|
||||
exit: mcall -1
|
||||
key:
|
||||
mcall 2 ;§ £à㧨¬ § 票¥ 2 ¢ ॣ¨áâ®à eax ¨ ¯®«ã稬 ª®¤ ¦ ⮩ ª« ¢¨è¨
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_key]
|
||||
|
||||
push dword edit2
|
||||
call [edit_box_key]
|
||||
|
||||
jmp still
|
||||
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
align 4
|
||||
draw_window: ;à¨á®¢ ¨¥ ®ª ¯à¨«®¦¥¨ï
|
||||
mcall 12,1
|
||||
mcall 0,(50*65536+390),(30*65536+200),0xb3AABBCC,0x805080DD,hed
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_draw]
|
||||
|
||||
push dword edit2
|
||||
call [edit_box_draw]
|
||||
|
||||
push dword check1
|
||||
call [check_box_draw]
|
||||
|
||||
push dword check2
|
||||
call [check_box_draw]
|
||||
|
||||
push dword Option_boxs
|
||||
call [option_box_draw]
|
||||
|
||||
push dword Option_boxs2
|
||||
call [option_box_draw]
|
||||
|
||||
mcall 12,2
|
||||
ret
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
;DATA ¤ ë¥
|
||||
ini_file db '/sys/lib/box_lib.obj',0
|
||||
myimport:
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
version_ed dd aVersion_ed
|
||||
|
||||
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_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',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
|
||||
|
||||
|
||||
|
||||
|
||||
check1 check_box 10,45,6,12,0x80AABBCC,0,0,check_text,14,ch_flag_en
|
||||
check2 check_box 10,60,6,12,0x80AABBCC,0,0,check_text2,15
|
||||
|
||||
edit1 edit_box 350,3,5,0xffffff,0x6f9480,0,0xAABBCC,0,308,hed,ed_focus,hed_end-hed-1,hed_end-hed-1
|
||||
edit2 edit_box 350,3,25,0xffffff,0x6a9480,0,0,0,99,ed_buffer,ed_figure_only
|
||||
|
||||
op1 option_box option_group1,10,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
|
||||
op2 option_box option_group1,10,105,6,12,0xFFFFFF,0,0,op_text.2,op_text.e2-op_text.2
|
||||
op3 option_box option_group1,10,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
|
||||
op11 option_box option_group2,120,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
|
||||
op12 option_box option_group2,120,105,6,12,0xffffff,0,0,op_text.2,op_text.e2-op_text.2
|
||||
op13 option_box option_group2,120,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
|
||||
|
||||
option_group1 dd op1 ;㪠§ ⥫¨, ®¨ ®â®¡à ¦ îâáï ¯® 㬮«ç ¨î, ª®£¤ ¢ë¢®¤¨âáï
|
||||
option_group2 dd op12 ;¯à¨«®¦¥¨¥
|
||||
Option_boxs dd op1,op2,op3,0
|
||||
Option_boxs2 dd op11,op12,op13,0
|
||||
hed db 'BOXs load from lib <Lrz> date 27.09.2007',0
|
||||
hed_end:
|
||||
rb 256
|
||||
check_text db 'First checkbox'
|
||||
check_text2 db 'Second checkbox'
|
||||
op_text: ; ‘®¯à®¢®¦¤ î騩 ⥪áâ ¤«ï 祪 ¡®ªá®¢
|
||||
.1 db 'Option_Box #1'
|
||||
.e1:
|
||||
.2 db 'Option_Box #2'
|
||||
.e2:
|
||||
.3 db 'Option_Box #3'
|
||||
.e3:
|
||||
ed_buffer rb 100
|
||||
way_of_ini rb 1024
|
||||
i_end:
|
||||
rb 1024
|
||||
mem:
|
BIN
programs/develop/libraries/box_lib/trunk/editbox_ex.kex
Normal file
BIN
programs/develop/libraries/box_lib/trunk/editbox_ex.kex
Normal file
Binary file not shown.
77
programs/develop/libraries/box_lib/trunk/editbox_ex.mac
Normal file
77
programs/develop/libraries/box_lib/trunk/editbox_ex.mac
Normal file
@ -0,0 +1,77 @@
|
||||
ed_struc_size=72
|
||||
struc edit_box width,left,top,color,shift_color,focus_border_color,\
|
||||
blur_border_color,text_color,max,text,flags,size,pos
|
||||
{
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;Bit mask from editbox
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
ed_figure_only= 1000000000000000b ;®¤¨ ᨬ¢®«ë
|
||||
ed_always_focus= 100000000000000b
|
||||
ed_focus= 10b ;䮪ãá ¯à¨«®¦¥¨ï
|
||||
ed_shift_on= 1000b ;¥á«¨ ¥ ãáâ ®¢«¥ -§ ç¨â ¢¯¥à¢ë¥ ¦ â shift,¥á«¨ ¡ë« ãáâ ®¢«¥, § ç¨â ¬ë 㦥 çâ® - â® ¤¥« «¨ 㤥ন¢ ï shift
|
||||
ed_shift_on_off=1111111111110111b
|
||||
ed_shift= 100b ;¢ª«îç ¥âáï ¯à¨ ¦ ⨨ shift â.¥. ¥á«¨ ¦¨¬ î
|
||||
ed_shift_off= 1111111111111011b
|
||||
ed_shift_bac= 10000b ;¡¨â ¤«ï ®ç¨á⪨ ¢ë¤¥«¥®£® shift â.¥. ¯à¨ ãáâ ®¢ª¥ £®¢®à¨â çâ® ¥áâì ¢ë¤¥«¥¨¥
|
||||
ed_shift_bac_cl=1111111111101111b ;®ç¨á⪠¯à¨ 㤠«¥¨¨ ¢ë¤¥«¥¨ï
|
||||
ed_shift_cl= 1111111111100011b
|
||||
ed_shift_mcl= 1111111111111011b
|
||||
ed_left_fl= 100000b
|
||||
ed_right_fl= 1111111111011111b
|
||||
ed_offset_fl= 1000000b
|
||||
ed_offset_cl= 1111111110111111b
|
||||
ed_insert= 10000000b
|
||||
ed_insert_cl= 1111111101111111b
|
||||
ed_mouse_on = 100000000b
|
||||
ed_mous_adn_b= 100011000b
|
||||
ed_mouse_on_off=1111111011111111b
|
||||
ed_height=14 ; ¢ëá®â
|
||||
|
||||
.width dd width
|
||||
.left dd left
|
||||
.top dd top
|
||||
.color dd color
|
||||
.shift_color dd shift_color
|
||||
.focus_border_color dd focus_border_color
|
||||
.blur_border_color dd blur_border_color
|
||||
.text_color dd text_color
|
||||
.max dd max
|
||||
.text dd text
|
||||
.flags dd flags+0
|
||||
.size dd size+0
|
||||
.pos dd pos+0
|
||||
.offset dd 0
|
||||
.cl_curs_x dd 0
|
||||
.cl_curs_y dd 0
|
||||
.shift dd 0
|
||||
.shift_old dd 0
|
||||
}
|
||||
struc check_box left,top,ch_text_margin,ch_size,color,border_color,text_color,text,ch_text_length,flags
|
||||
{ ;áâàãªâãà ¯ à ¬¥â஢ ¤«ï 祪 ¡®ªá
|
||||
ch_flag_en=10b
|
||||
.left: dw left ;+0 ;¯®«®¦¥¨¥ ¯® å
|
||||
.top: dw top ;¯®«®¦¥¨¥ ¯® ã
|
||||
.ch_text_margin: dd ch_text_margin ;à ááâ®ï¨¥ ®â ¯àאַ㣮«ì¨ª 祪 ¡®ªá ¤® ¤¯¨á¨
|
||||
.ch_size: dd ch_size ;à §¬¥à ª¢ ¤à â 祪 ¡®ªá , ¤«ï ¯à¨¬¥à 12
|
||||
.color: dd color ;梥⠢ãâਠ祪¡®ªá
|
||||
.border_color: dd border_color ;梥â à ¬ª¨
|
||||
.text_color: dd text_color ;梥⠤¯¨á¨
|
||||
.text: dd text ; ¤à¥á ¢ ª®¤¥ ¯à®£à ¬¬ë £¤¥ à ᯮ«®¦¥ ⥪áâ
|
||||
.ch_text_length: dd ch_text_length ;¤«¨ áâப¨ á ᨬ¢®« ¬¨
|
||||
.flags: dd flags+0 ; ä« £¨
|
||||
}
|
||||
struc option_box point_gr,left,top,op_text_margin,op_size,color,border_color,text_color,text,op_text_length,flags
|
||||
{ ;áâàãªâãà ¯ à ¬¥â஢ ¤«ï 祪 ¡®ªá
|
||||
op_flag_en=10b
|
||||
.option_group: dd point_gr
|
||||
.left: dw left ;+0 ;¯®«®¦¥¨¥ ¯® å
|
||||
.top: dw top ;¯®«®¦¥¨¥ ¯® ã
|
||||
.ch_text_margin: dd op_text_margin ;à ááâ®ï¨¥ ®â ¯àאַ㣮«ì¨ª 祪 ¡®ªá ¤® ¤¯¨á¨
|
||||
.ch_size: dd op_size ;à §¬¥à ª¢ ¤à â 祪 ¡®ªá , ¤«ï ¯à¨¬¥à 12
|
||||
.color: dd color ;梥⠢ãâਠ祪¡®ªá
|
||||
.border_color: dd border_color ;梥â à ¬ª¨
|
||||
.text_color: dd text_color ;梥⠤¯¨á¨
|
||||
.text: dd text ; ¤à¥á ¢ ª®¤¥ ¯à®£à ¬¬ë £¤¥ à ᯮ«®¦¥ ⥪áâ
|
||||
.ch_text_length: dd op_text_length ;¤«¨ áâப¨ á ᨬ¢®« ¬¨
|
||||
.flags: dd flags+0 ; ä« £¨
|
||||
}
|
502
programs/develop/libraries/box_lib/trunk/macros.inc
Normal file
502
programs/develop/libraries/box_lib/trunk/macros.inc
Normal file
@ -0,0 +1,502 @@
|
||||
@^ fix macro comment {
|
||||
^@ fix }
|
||||
|
||||
|
||||
macro m2m dest,src {
|
||||
push src
|
||||
pop dest
|
||||
}
|
||||
|
||||
|
||||
macro iglobal {
|
||||
IGlobals equ IGlobals,
|
||||
macro __IGlobalBlock { }
|
||||
|
||||
macro uglobal {
|
||||
UGlobals equ UGlobals,
|
||||
macro __UGlobalBlock { }
|
||||
|
||||
endg fix } ; Use endg for ending iglobal and uglobal blocks.
|
||||
|
||||
|
||||
macro IncludeIGlobals{
|
||||
macro IGlobals dummy,[n] \{ __IGlobalBlock
|
||||
purge __IGlobalBlock \}
|
||||
match I, IGlobals \{ I \} }
|
||||
|
||||
macro IncludeUGlobals{
|
||||
macro UGlobals dummy,[n] \{
|
||||
\common
|
||||
\local begin, size
|
||||
begin = $
|
||||
virtual at $
|
||||
\forward
|
||||
__UGlobalBlock
|
||||
purge __UGlobalBlock
|
||||
\common
|
||||
size = $ - begin
|
||||
end virtual
|
||||
rb size
|
||||
\}
|
||||
match U, UGlobals \{ U \} }
|
||||
|
||||
uglobal
|
||||
endg
|
||||
|
||||
iglobal
|
||||
endg
|
||||
|
||||
|
||||
; new application structure
|
||||
macro meos_app_start
|
||||
{
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd __start
|
||||
dd __end
|
||||
dd __memory
|
||||
dd __stack
|
||||
|
||||
if used __params & ~defined __params
|
||||
dd __params
|
||||
else
|
||||
dd 0x0
|
||||
end if
|
||||
|
||||
dd 0x0
|
||||
}
|
||||
MEOS_APP_START fix meos_app_start
|
||||
|
||||
macro code
|
||||
{
|
||||
__start:
|
||||
}
|
||||
CODE fix code
|
||||
|
||||
macro data
|
||||
{
|
||||
__data:
|
||||
IncludeIGlobals
|
||||
}
|
||||
DATA fix data
|
||||
|
||||
macro udata
|
||||
{
|
||||
if used __params & ~defined __params
|
||||
__params:
|
||||
db 0
|
||||
__end:
|
||||
rb 255
|
||||
else
|
||||
__end:
|
||||
end if
|
||||
__udata:
|
||||
IncludeUGlobals
|
||||
}
|
||||
UDATA fix udata
|
||||
|
||||
macro meos_app_end
|
||||
{
|
||||
align 32
|
||||
rb 2048
|
||||
__stack:
|
||||
__memory:
|
||||
}
|
||||
MEOS_APP_END fix meos_app_end
|
||||
|
||||
|
||||
; macro for defining multiline text data
|
||||
struc mstr [sstring]
|
||||
{
|
||||
forward
|
||||
local ssize
|
||||
virtual at 0
|
||||
db sstring
|
||||
ssize = $
|
||||
end virtual
|
||||
dd ssize
|
||||
db sstring
|
||||
common
|
||||
dd -1
|
||||
}
|
||||
|
||||
; macro for defining multiline text data
|
||||
struc mls [sstring]
|
||||
{
|
||||
forward
|
||||
local ssize
|
||||
virtual at 0
|
||||
db sstring ; mod
|
||||
ssize = $
|
||||
end virtual
|
||||
db ssize
|
||||
db sstring
|
||||
common
|
||||
db -1 ; mod
|
||||
}
|
||||
|
||||
|
||||
|
||||
; strings
|
||||
macro sz name,[data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
name db data
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
if used name
|
||||
label name
|
||||
forward
|
||||
if lang eq lng
|
||||
db data
|
||||
end if
|
||||
common
|
||||
.size = $-name
|
||||
end if
|
||||
}
|
||||
|
||||
macro szc name,elsz,[data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
local s,m
|
||||
m = 0
|
||||
if used name
|
||||
label name
|
||||
forward
|
||||
virtual at 0
|
||||
db data
|
||||
s = $
|
||||
end virtual
|
||||
d#elsz s
|
||||
if m < s
|
||||
m = s
|
||||
end if
|
||||
db data
|
||||
common
|
||||
.size = $-name
|
||||
.maxl = m
|
||||
end if
|
||||
}
|
||||
|
||||
macro lszc name,elsz,[lng,data] { ; from MFAR [mike.dld]
|
||||
common
|
||||
local s,m,c
|
||||
m = 0
|
||||
c = 0
|
||||
if used name
|
||||
label name
|
||||
forward
|
||||
if lang eq lng
|
||||
virtual at 0
|
||||
db data
|
||||
s = $
|
||||
end virtual
|
||||
d#elsz s
|
||||
if m < s
|
||||
m = s
|
||||
end if
|
||||
db data
|
||||
c = c+1
|
||||
end if
|
||||
common
|
||||
.size = $-name
|
||||
.maxl = m
|
||||
.count = c
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
; easy system call macro
|
||||
macro mpack dest, hsrc, lsrc
|
||||
{
|
||||
if (hsrc eqtype 0) & (lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16 + lsrc
|
||||
else
|
||||
if (hsrc eqtype 0) & (~lsrc eqtype 0)
|
||||
mov dest, (hsrc) shl 16
|
||||
add dest, lsrc
|
||||
else
|
||||
mov dest, hsrc
|
||||
shl dest, 16
|
||||
add dest, lsrc
|
||||
end if
|
||||
end if
|
||||
}
|
||||
|
||||
macro __mov reg,a,b { ; mike.dld
|
||||
if (~a eq)&(~b eq)
|
||||
mpack reg,a,b
|
||||
else if (~a eq)&(b eq)
|
||||
mov reg,a
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
include 'config.inc'
|
||||
;__CPU_type equ p5
|
||||
SYSENTER_VAR equ 0
|
||||
|
||||
macro mcall a,b,c,d,e,f,i { ; mike.dld, updated by Ghost for Fast System Calls
|
||||
local ..ret_point
|
||||
__mov eax,a
|
||||
__mov ebx,b
|
||||
__mov ecx,c
|
||||
__mov edx,d
|
||||
__mov esi,e
|
||||
__mov edi,f
|
||||
__mov ebp,i
|
||||
|
||||
if __CPU_type eq p5
|
||||
int 0x40
|
||||
else
|
||||
if __CPU_type eq p6
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
push ..ret_point ; it may be 2 or 5 byte
|
||||
sysenter
|
||||
..ret_point:
|
||||
pop edx
|
||||
pop ecx
|
||||
|
||||
else
|
||||
if __CPU_type eq k6
|
||||
push ecx
|
||||
syscall
|
||||
pop ecx
|
||||
else
|
||||
display 'ERROR : unknown CPU type'
|
||||
int 0x40
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
; -------------------------
|
||||
macro header a,[b] {
|
||||
common
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET',a
|
||||
forward
|
||||
if b eq
|
||||
dd 0
|
||||
else
|
||||
dd b
|
||||
end if }
|
||||
macro section name { align 16
|
||||
label name }
|
||||
macro func name {
|
||||
if ~used name
|
||||
display 'FUNC NOT USED: ',`name,13,10
|
||||
else
|
||||
align 4
|
||||
name:
|
||||
;diff16 `name,0,name
|
||||
;pushad
|
||||
;pushfd
|
||||
;dps `name
|
||||
;newline
|
||||
;mcall 5,1
|
||||
;popfd
|
||||
;popad
|
||||
}
|
||||
macro endf { end if }
|
||||
|
||||
macro diff16 title,l1,l2
|
||||
{
|
||||
local s,d
|
||||
s = l2-l1
|
||||
display title,': 0x'
|
||||
repeat 8
|
||||
d = '0' + s shr ((8-%) shl 2) and $0F
|
||||
if d > '9'
|
||||
d = d + 'A'-'9'-1
|
||||
end if
|
||||
display d
|
||||
end repeat
|
||||
display 13,10
|
||||
}
|
||||
|
||||
macro diff10 title,l1,l2
|
||||
{
|
||||
local s,d,z,m
|
||||
s = l2-l1
|
||||
z = 0
|
||||
m = 1000000000
|
||||
display title,': '
|
||||
repeat 10
|
||||
d = '0' + s / m
|
||||
s = s - (s/m)*m
|
||||
m = m / 10
|
||||
if d <> '0'
|
||||
z = 1
|
||||
end if
|
||||
if z <> 0
|
||||
display d
|
||||
end if
|
||||
end repeat
|
||||
display 13,10
|
||||
}
|
||||
|
||||
; optimize the code for size
|
||||
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
|
||||
|
||||
macro add arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
inc arg1
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
else
|
||||
add arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro sub arg1,arg2
|
||||
{
|
||||
if (arg2 eqtype 0)
|
||||
if (arg2) = 1
|
||||
dec arg1
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
else
|
||||
sub arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
macro mov arg1,arg2
|
||||
{
|
||||
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
|
||||
if (arg2) = 0
|
||||
xor arg1,arg1
|
||||
else if (arg2) = 1
|
||||
xor arg1,arg1
|
||||
inc arg1
|
||||
else if (arg2) = -1
|
||||
or arg1,-1
|
||||
else if (arg2) > -128 & (arg2) < 128
|
||||
push arg2
|
||||
pop arg1
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
else
|
||||
mov arg1,arg2
|
||||
end if
|
||||
}
|
||||
|
||||
|
||||
macro RGB [a] {
|
||||
common
|
||||
match (r=,g=,b),a \{
|
||||
\dd ((r) shl 16) or ((g) shl 8) or (b)
|
||||
\}
|
||||
}
|
||||
|
||||
|
||||
struc POINT _t,_dx,_dy {
|
||||
.x _t _dx
|
||||
.y _t _dy
|
||||
}
|
||||
|
||||
; structure definition helper
|
||||
include 'struct.inc'
|
||||
|
||||
struct RECT
|
||||
left dd ?
|
||||
top dd ?
|
||||
right dd ?
|
||||
bottom dd ?
|
||||
ends
|
||||
|
||||
struct BOX
|
||||
left dd ?
|
||||
top dd ?
|
||||
width dd ?
|
||||
height dd ?
|
||||
ends
|
||||
|
||||
; structures used in MeOS
|
||||
struct process_information
|
||||
cpu_usage dd ? ; +0
|
||||
window_stack_position dw ? ; +4
|
||||
window_stack_value dw ? ; +6
|
||||
dw ? ; +8
|
||||
process_name rb 12 ; +10
|
||||
memory_start dd ? ; +22
|
||||
used_memory dd ? ; +26
|
||||
PID dd ? ; +30
|
||||
box BOX ; +34
|
||||
slot_state dw ? ; +50
|
||||
dw ? ; +52
|
||||
client_box BOX ; +54
|
||||
wnd_state db ? ; +70
|
||||
rb (1024-71)
|
||||
ends
|
||||
|
||||
struct system_colors
|
||||
frame dd ?
|
||||
grab dd ?
|
||||
grab_button dd ?
|
||||
grab_button_text dd ?
|
||||
grab_text dd ?
|
||||
work dd ?
|
||||
work_button dd ?
|
||||
work_button_text dd ?
|
||||
work_text dd ?
|
||||
work_graph dd ?
|
||||
ends
|
||||
|
||||
struct FILEDATE
|
||||
Second db ?
|
||||
Minute db ?
|
||||
Hour db ?
|
||||
db ?
|
||||
Day db ?
|
||||
Month db ?
|
||||
Year dw ?
|
||||
ends
|
||||
|
||||
struct FILEINFO
|
||||
Attributes dd ?
|
||||
IsUnicode db ?
|
||||
db 3 dup(?)
|
||||
DateCreate FILEDATE
|
||||
DateAccess FILEDATE
|
||||
DateModify FILEDATE
|
||||
Size dq ?
|
||||
ends
|
||||
|
||||
; constants
|
||||
|
||||
; events
|
||||
EV_IDLE = 0
|
||||
EV_TIMER = 0
|
||||
EV_REDRAW = 1
|
||||
EV_KEY = 2
|
||||
EV_BUTTON = 3
|
||||
EV_EXIT = 4
|
||||
EV_BACKGROUND = 5
|
||||
EV_MOUSE = 6
|
||||
EV_IPC = 7
|
||||
EV_STACK = 8
|
||||
|
||||
; event mask bits for function 40
|
||||
EVM_REDRAW = 1b
|
||||
EVM_KEY = 10b
|
||||
EVM_BUTTON = 100b
|
||||
EVM_EXIT = 1000b
|
||||
EVM_BACKGROUND = 10000b
|
||||
EVM_MOUSE = 100000b
|
||||
EVM_IPC = 1000000b
|
||||
EVM_STACK = 10000000b
|
201
programs/develop/libraries/box_lib/trunk/optionbox.mac
Normal file
201
programs/develop/libraries/box_lib/trunk/optionbox.mac
Normal file
@ -0,0 +1,201 @@
|
||||
;файл создан 13.02.2009 <Lrz> На код применена GPL2 лицензия
|
||||
;Макрос для системной библиотеки box_lib.obj
|
||||
;Optionbox
|
||||
|
||||
macro use_optionbox_driver ;макросы которые управляют работой бокса )
|
||||
{
|
||||
option_box_draw:
|
||||
pusha
|
||||
|
||||
mov eax,dword [esp+36]
|
||||
@@: mov edi,dword [eax]
|
||||
test edi,edi
|
||||
je option_check
|
||||
call option_box_draw_box
|
||||
add eax,4
|
||||
jmp @b
|
||||
|
||||
option_check:
|
||||
mov eax,dword [esp+36]
|
||||
@@: mov edi,dword [eax]
|
||||
test edi,edi
|
||||
je @f
|
||||
|
||||
mov ebx,dword [edi]
|
||||
mov ebx,dword [ebx]
|
||||
cmp edi,ebx
|
||||
jne .clear_op
|
||||
|
||||
pusha
|
||||
call option_box_draw_op
|
||||
popa
|
||||
add eax,4
|
||||
jmp @b
|
||||
|
||||
.clear_op:
|
||||
pusha
|
||||
call option_box_clear_op
|
||||
popa
|
||||
add eax,4
|
||||
jmp @b
|
||||
|
||||
|
||||
@@: popa
|
||||
ret 4
|
||||
; exit вообще :)
|
||||
|
||||
|
||||
option_box_mouse:
|
||||
pusha
|
||||
|
||||
mov eax,dword [esp+36]
|
||||
@@: mov edi,dword [eax]
|
||||
test edi,edi
|
||||
je option_check
|
||||
call option_box_mouse_op
|
||||
add eax,4
|
||||
jmp @b
|
||||
|
||||
}
|
||||
macro use_optionbox_draw
|
||||
{
|
||||
option_box_draw_box:
|
||||
option_group equ [edi]
|
||||
op_left equ [edi+4] ;координата начала рисования по х
|
||||
op_top equ [edi+6] ;координата начала рисования по у
|
||||
op_text_margin equ [edi+8] ;=4 расстояние от прямоугольника чек бокса до надписи
|
||||
op_size equ [edi+12] ;12 размер квадрата чек бокса
|
||||
op_color equ [edi+16]
|
||||
op_border_color equ [edi+20] ; or [edi+4] ;цвет рамки checkbox ее можно задать самостоятельно
|
||||
op_text_color equ [edi+24];[edi+4] ;цвет текста
|
||||
op_text_ptr equ [edi+28] ;указатель на начало текстовой строки
|
||||
op_text_length equ [edi+32]
|
||||
op_flags equ [edi+36] ;флаги
|
||||
|
||||
pusha ;сохраним все регистры
|
||||
|
||||
movzx ebx,word op_left
|
||||
shl ebx,16
|
||||
add ebx,dword op_size
|
||||
movzx ecx,word op_top
|
||||
shl ecx,16
|
||||
add ecx,dword op_size
|
||||
mov edx,dword op_border_color
|
||||
mov eax,13
|
||||
mcall ;рисуем рамку
|
||||
|
||||
mov edx,dword op_color
|
||||
add ebx,1 shl 16 - 2
|
||||
add ecx,1 shl 16 - 2
|
||||
mcall ;закрашиваем внутренности чекбокса
|
||||
|
||||
; mov eax,dword option_group
|
||||
; mov dword eax,[eax]
|
||||
; cmp eax,edi
|
||||
; jne @f
|
||||
; call option_box_draw_op ;нарисовать включенный чек бокс
|
||||
|
||||
|
||||
;----------------------------
|
||||
;расчет куда будет произведен вывод текста
|
||||
;----------------------------
|
||||
@@: movzx ebx,word op_left ;загрузить значение х для чек бокса
|
||||
add ebx,dword op_size
|
||||
add ebx,dword op_text_margin;добавить размер стороны и расстояние на котором начнется вывод текста
|
||||
shl ebx,16 ;сдвинем на 16 разрядов в лево (умножим на 65536)
|
||||
mov bx,word op_top ;загрузим значение по y
|
||||
add ebx,op_size
|
||||
mov ecx,dword op_text_color ;загрузим цвет надписи + flags
|
||||
sub ebx,7 ;добавим значение длины стороны -9+2
|
||||
|
||||
mov edx,dword op_text_ptr ;укажем адрес от куда нужно выводить строку
|
||||
mov esi,dword op_text_length
|
||||
;внесем в eax значение вывода надписи на канву
|
||||
mov eax,4
|
||||
mcall ;Вывод
|
||||
popa ;восстановить значения регистров из стека
|
||||
ret ;выйдем из процедуры
|
||||
|
||||
option_box_clear_op: ;очистка чек бокса
|
||||
mov edx,dword op_color ;цвет внутри чек бокса
|
||||
jmp @f ;безусловный прыжок на нижнюю метку @@
|
||||
|
||||
|
||||
option_box_draw_op: ;нарисовать включенный чек бокс
|
||||
mov edx,dword op_border_color ;загрузить цвет
|
||||
@@:
|
||||
movzx ebx,word op_left ;загрузить координату по х
|
||||
mov eax,dword op_size
|
||||
push ax
|
||||
shr eax,2
|
||||
add ebx,eax ;добавить (сторона прямоугольника/3)
|
||||
shl ebx,16 ;сдвинем на 16 разрядов в лево (умножим на 65536)
|
||||
pop bx
|
||||
shr bx,1 ;загрузить (сторона прямоугольника/2)
|
||||
mov bp,bx ;сохраним регистр bx в регистре указателя базы
|
||||
|
||||
movzx ecx,word op_top ;загрузить координату по у
|
||||
mov eax,dword op_size
|
||||
shr eax,2
|
||||
add ecx,eax ;добавить (сторона прямоугольника/4)
|
||||
shl ecx,16 ;сдвинем на 16 разрядов в лево (умножим на 65536)
|
||||
mov cx,bp ;загрузим значения регистра указателя базы в cx
|
||||
mov eax,13 ;в eax - значения функции для вывода полосы т.е. по сути прямоугольника, который отображает включенный компонент чек бокс
|
||||
mcall ;вывод
|
||||
ret ;выйти из процедуры
|
||||
|
||||
}
|
||||
|
||||
|
||||
macro use_optionbox_mouse
|
||||
{
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;Обработчик mouse
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
option_box_mouse_op: ;обработка мыши
|
||||
pusha
|
||||
mov eax,37 ;будем что то делать если у нас что - нить нажато
|
||||
mov ebx,2 ;внести в регистр значение 2
|
||||
mcall ;проверка не нажал ли пользователь кнопку мышки
|
||||
test eax,eax ;проверка если у нас в eax=0, то установим флаг и выйдем
|
||||
jnz @f ;перейти на нижнюю метку @@
|
||||
|
||||
jmp option_box_mouse_end
|
||||
;если ничего не произошло, то восстановим значения регистров из стека
|
||||
;выход
|
||||
@@:
|
||||
mov esi,dword op_text_length ;загрузить кол-во символов в текстовой строке
|
||||
;Умножение на 6 Быстрое умножение можно воспользоваться любым мз методов, но на старых Процессорах (386,486,P1)быстрее будет с инструкцией Lea
|
||||
;lea esi,[eax*2+eax]
|
||||
;shl eax,1
|
||||
imul esi,6 ; или можно и так умножить на 6
|
||||
xor ebx,ebx
|
||||
add esi,dword op_text_margin ;добавить 3 - расстояние от чек бокса до надписи
|
||||
|
||||
mov eax,37 ;получим координаты мышки
|
||||
inc ebx ;добавить 1
|
||||
mcall ;получить координаты курсора относительно окна
|
||||
|
||||
movzx ebx,word op_top ;загрузить в bx значение координаты у
|
||||
cmp ax,bx ;сравнить с с координатой курсора
|
||||
jl option_box_mouse_end ;SF <> OF если меньше
|
||||
add ebx,dword op_size ;добавить размер
|
||||
cmp ax,bx ;сравнить
|
||||
jg option_box_mouse_end ;ZF = 0 и SF = OF если больше
|
||||
|
||||
shr eax,16 ;разделим на 65536 или просто сдвинем биты на 16 значений
|
||||
movzx ebx,word op_left ;произведем аналогичное сравнение
|
||||
cmp ax,bx ;сравнить регистры
|
||||
jl option_box_mouse_end ;если меньше
|
||||
add ebx,dword op_size ;добавить длину стороны прямоугольника
|
||||
add ebx,esi ;Учесть в значении по х еще и длину надписи к чекбоксу
|
||||
cmp ax,bx ;стравнить регистры
|
||||
jg option_box_mouse_end ;если больше
|
||||
mov eax,dword option_group
|
||||
mov [eax],edi
|
||||
|
||||
option_box_mouse_end:
|
||||
popa ;восстановить регистры из стека
|
||||
ret ;выйти
|
||||
|
||||
}
|
270
programs/develop/libraries/box_lib/trunk/proc32.inc
Normal file
270
programs/develop/libraries/box_lib/trunk/proc32.inc
Normal file
@ -0,0 +1,270 @@
|
||||
|
||||
; Macroinstructions for defining and calling procedures
|
||||
|
||||
macro stdcall proc,[arg] ; directly call STDCALL procedure
|
||||
{ common
|
||||
if ~ arg eq
|
||||
reverse
|
||||
pushd arg
|
||||
common
|
||||
end if
|
||||
call proc }
|
||||
|
||||
macro invoke proc,[arg] ; indirectly call STDCALL procedure
|
||||
{ common
|
||||
if ~ arg eq
|
||||
reverse
|
||||
pushd arg
|
||||
common
|
||||
end if
|
||||
call [proc] }
|
||||
|
||||
macro ccall proc,[arg] ; directly call CDECL procedure
|
||||
{ common
|
||||
size@ccall = 0
|
||||
if ~ arg eq
|
||||
reverse
|
||||
pushd arg
|
||||
size@ccall = size@ccall+4
|
||||
common
|
||||
end if
|
||||
call proc
|
||||
if size@ccall
|
||||
add esp,size@ccall
|
||||
end if }
|
||||
|
||||
macro cinvoke proc,[arg] ; indirectly call CDECL procedure
|
||||
{ common
|
||||
size@ccall = 0
|
||||
if ~ arg eq
|
||||
reverse
|
||||
pushd arg
|
||||
size@ccall = size@ccall+4
|
||||
common
|
||||
end if
|
||||
call [proc]
|
||||
if size@ccall
|
||||
add esp,size@ccall
|
||||
end if }
|
||||
|
||||
macro proc [args] ; define procedure
|
||||
{ common
|
||||
match name params, args>
|
||||
\{ define@proc name,<params \} }
|
||||
|
||||
prologue@proc equ prologuedef
|
||||
|
||||
macro prologuedef procname,flag,parmbytes,localbytes,reglist
|
||||
{ if parmbytes | localbytes
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
if localbytes
|
||||
sub esp,localbytes
|
||||
end if
|
||||
end if
|
||||
irps reg, reglist \{ push reg \} }
|
||||
|
||||
epilogue@proc equ epiloguedef
|
||||
|
||||
macro epiloguedef procname,flag,parmbytes,localbytes,reglist
|
||||
{ irps reg, reglist \{ reverse pop reg \}
|
||||
if parmbytes | localbytes
|
||||
leave
|
||||
end if
|
||||
if flag and 10000b
|
||||
retn
|
||||
else
|
||||
retn parmbytes
|
||||
end if }
|
||||
|
||||
macro define@proc name,statement
|
||||
{ local params,flag,regs,parmbytes,localbytes,current
|
||||
if used name
|
||||
name:
|
||||
match =stdcall args, statement \{ params equ args
|
||||
flag = 11b \}
|
||||
match =stdcall, statement \{ params equ
|
||||
flag = 11b \}
|
||||
match =c args, statement \{ params equ args
|
||||
flag = 10001b \}
|
||||
match =c, statement \{ params equ
|
||||
flag = 10001b \}
|
||||
match =params, params \{ params equ statement
|
||||
flag = 0 \}
|
||||
virtual at ebp+8
|
||||
match =uses reglist=,args, params \{ regs equ reglist
|
||||
params equ args \}
|
||||
match =regs =uses reglist, regs params \{ regs equ reglist
|
||||
params equ \}
|
||||
match =regs, regs \{ regs equ \}
|
||||
match =,args, params \{ defargs@proc args \}
|
||||
match =args@proc args, args@proc params \{ defargs@proc args \}
|
||||
parmbytes = $ - (ebp+8)
|
||||
end virtual
|
||||
name # % = parmbytes/4
|
||||
all@vars equ
|
||||
current = 0
|
||||
match prologue:reglist, prologue@proc:<regs> \{ prologue name,flag,parmbytes,localbytes,reglist \}
|
||||
macro locals
|
||||
\{ virtual at ebp-localbytes+current
|
||||
macro label def \\{ match . type,def> \\\{ deflocal@proc .,label,<type \\\} \\}
|
||||
struc db [val] \\{ \common deflocal@proc .,db,val \\}
|
||||
struc du [val] \\{ \common deflocal@proc .,du,val \\}
|
||||
struc dw [val] \\{ \common deflocal@proc .,dw,val \\}
|
||||
struc dp [val] \\{ \common deflocal@proc .,dp,val \\}
|
||||
struc dd [val] \\{ \common deflocal@proc .,dd,val \\}
|
||||
struc dt [val] \\{ \common deflocal@proc .,dt,val \\}
|
||||
struc dq [val] \\{ \common deflocal@proc .,dq,val \\}
|
||||
struc rb cnt \\{ deflocal@proc .,rb cnt, \\}
|
||||
struc rw cnt \\{ deflocal@proc .,rw cnt, \\}
|
||||
struc rp cnt \\{ deflocal@proc .,rp cnt, \\}
|
||||
struc rd cnt \\{ deflocal@proc .,rd cnt, \\}
|
||||
struc rt cnt \\{ deflocal@proc .,rt cnt, \\}
|
||||
struc rq cnt \\{ deflocal@proc .,rq cnt, \\} \}
|
||||
macro endl
|
||||
\{ purge label
|
||||
restruc db,du,dw,dp,dd,dt,dq
|
||||
restruc rb,rw,rp,rd,rt,rq
|
||||
current = $-(ebp-localbytes)
|
||||
end virtual \}
|
||||
macro ret operand
|
||||
\{ match any, operand \\{ retn operand \\}
|
||||
match , operand \\{ match epilogue:reglist, epilogue@proc:<regs>
|
||||
\\\{ epilogue name,flag,parmbytes,localbytes,reglist \\\} \\} \}
|
||||
macro finish@proc \{ localbytes = (((current-1) shr 2)+1) shl 2
|
||||
end if \} }
|
||||
|
||||
macro defargs@proc [arg]
|
||||
{ common
|
||||
if ~ arg eq
|
||||
forward
|
||||
local ..arg,current@arg
|
||||
match argname:type, arg
|
||||
\{ current@arg equ argname
|
||||
label ..arg type
|
||||
argname equ ..arg
|
||||
if dqword eq type
|
||||
dd ?,?,?,?
|
||||
else if tbyte eq type
|
||||
dd ?,?,?
|
||||
else if qword eq type | pword eq type
|
||||
dd ?,?
|
||||
else
|
||||
dd ?
|
||||
end if \}
|
||||
match =current@arg,current@arg
|
||||
\{ current@arg equ arg
|
||||
arg equ ..arg
|
||||
..arg dd ? \}
|
||||
common
|
||||
args@proc equ current@arg
|
||||
forward
|
||||
restore current@arg
|
||||
common
|
||||
end if }
|
||||
|
||||
macro deflocal@proc name,def,[val]
|
||||
{ common
|
||||
match vars, all@vars \{ all@vars equ all@vars, \}
|
||||
all@vars equ all@vars name
|
||||
forward
|
||||
local ..var,..tmp
|
||||
match =label,def \{ ..tmp equ \}
|
||||
match tmp,..tmp \{ ..var def val \}
|
||||
match ,..tmp \{ label ..var val \}
|
||||
match =?, val \{ ..tmp equ \}
|
||||
match any =dup (=?), val \{ ..tmp equ \}
|
||||
match tmp : value, ..tmp : val
|
||||
\{ tmp: end virtual
|
||||
initlocal@proc ..var,def value
|
||||
virtual at tmp\}
|
||||
common
|
||||
match first rest, ..var, \{ name equ first \} }
|
||||
|
||||
macro initlocal@proc name,def
|
||||
{ virtual at name
|
||||
def
|
||||
size@initlocal = $ - name
|
||||
end virtual
|
||||
position@initlocal = 0
|
||||
while size@initlocal > position@initlocal
|
||||
virtual at name
|
||||
def
|
||||
if size@initlocal - position@initlocal < 2
|
||||
current@initlocal = 1
|
||||
load byte@initlocal byte from name+position@initlocal
|
||||
else if size@initlocal - position@initlocal < 4
|
||||
current@initlocal = 2
|
||||
load word@initlocal word from name+position@initlocal
|
||||
else
|
||||
current@initlocal = 4
|
||||
load dword@initlocal dword from name+position@initlocal
|
||||
end if
|
||||
end virtual
|
||||
if current@initlocal = 1
|
||||
mov byte [name+position@initlocal],byte@initlocal
|
||||
else if current@initlocal = 2
|
||||
mov word [name+position@initlocal],word@initlocal
|
||||
else
|
||||
mov dword [name+position@initlocal],dword@initlocal
|
||||
end if
|
||||
position@initlocal = position@initlocal + current@initlocal
|
||||
end while }
|
||||
|
||||
macro endp
|
||||
{ purge ret,locals,endl
|
||||
finish@proc
|
||||
purge finish@proc
|
||||
restore regs@proc
|
||||
match all,args@proc \{ restore all \}
|
||||
restore args@proc
|
||||
match all,all@vars \{ restore all \} }
|
||||
|
||||
macro local [var]
|
||||
{ common
|
||||
locals
|
||||
forward done@local equ
|
||||
match varname[count]:vartype, var
|
||||
\{ match =BYTE, vartype \\{ varname rb count
|
||||
restore done@local \\}
|
||||
match =WORD, vartype \\{ varname rw count
|
||||
restore done@local \\}
|
||||
match =DWORD, vartype \\{ varname rd count
|
||||
restore done@local \\}
|
||||
match =PWORD, vartype \\{ varname rp count
|
||||
restore done@local \\}
|
||||
match =QWORD, vartype \\{ varname rq count
|
||||
restore done@local \\}
|
||||
match =TBYTE, vartype \\{ varname rt count
|
||||
restore done@local \\}
|
||||
match =DQWORD, vartype \\{ label varname dqword
|
||||
rq count+count
|
||||
restore done@local \\}
|
||||
match , done@local \\{ virtual
|
||||
varname vartype
|
||||
end virtual
|
||||
rb count*sizeof.\#vartype
|
||||
restore done@local \\} \}
|
||||
match :varname:vartype, done@local:var
|
||||
\{ match =BYTE, vartype \\{ varname db ?
|
||||
restore done@local \\}
|
||||
match =WORD, vartype \\{ varname dw ?
|
||||
restore done@local \\}
|
||||
match =DWORD, vartype \\{ varname dd ?
|
||||
restore done@local \\}
|
||||
match =PWORD, vartype \\{ varname dp ?
|
||||
restore done@local \\}
|
||||
match =QWORD, vartype \\{ varname dq ?
|
||||
restore done@local \\}
|
||||
match =TBYTE, vartype \\{ varname dt ?
|
||||
restore done@local \\}
|
||||
match =DQWORD, vartype \\{ label varname dqword
|
||||
dq ?,?
|
||||
restore done@local \\}
|
||||
match , done@local \\{ varname vartype
|
||||
restore done@local \\} \}
|
||||
match ,done@local
|
||||
\{ var
|
||||
restore done@local \}
|
||||
common
|
||||
endl }
|
14
programs/develop/libraries/box_lib/trunk/readme.txt
Normal file
14
programs/develop/libraries/box_lib/trunk/readme.txt
Normal file
@ -0,0 +1,14 @@
|
||||
<Lrz> Теплов Алексей, Челябинск.
|
||||
Пример простого испльзования editbox в библиотеке,
|
||||
EditBox переписан для работы в библиотеке.
|
||||
Дата 25.06.2008
|
||||
сделана поддержка запуска ассемблерного примера при расположении текущей библиотеки по 2-м местам
|
||||
1. /sys/lib/box_lib.obj и когда библиотека находиться в папке с программой.
|
||||
|
||||
Дата 21.09.2007
|
||||
Сделан упор на поддрежку С и передачи параметров в стеке stdcall.
|
||||
На данный момент, носит эксперементальный, тестовый характер.
|
||||
Библиотеку box_lib.obj нужно поместить в папку с выполняющейся программой editbox_ex, или по адресу /sys/lib/? но тогда нужно подменить путь в файле ini_file на путь к библиотеке
|
||||
. Пример сам вычисляет путь к библиотеке, не зависимо от своего месторасположения
|
||||
13.09.2009 - обработка клавишь NUM, Caps,Scroll Lock. При нажатии на них, не происходит отображение символа.
|
||||
24.09.2007 - сделал поддрежку checkbox. Добавил ошибки, программа глючит очень серьезно :(
|
4
programs/develop/libraries/box_lib/trunk/run.bat
Normal file
4
programs/develop/libraries/box_lib/trunk/run.bat
Normal file
@ -0,0 +1,4 @@
|
||||
@fasm.exe -m 16384 box_lib.asm
|
||||
@fasm.exe -m 16384 editbox_ex.asm editbox_ex.kex
|
||||
REM ..\FASM\kpack.exe editbox_ex
|
||||
@klbrinwin.exe editbox_ex.kex
|
180
programs/develop/libraries/box_lib/trunk/struct.inc
Normal file
180
programs/develop/libraries/box_lib/trunk/struct.inc
Normal file
@ -0,0 +1,180 @@
|
||||
|
||||
; Macroinstructions for defining data structures
|
||||
|
||||
macro struct name
|
||||
{ fields@struct equ name
|
||||
match child parent, name \{ fields@struct equ child,fields@\#parent \}
|
||||
sub@struct equ
|
||||
struc db [val] \{ \common fields@struct equ fields@struct,.,db,<val> \}
|
||||
struc dw [val] \{ \common fields@struct equ fields@struct,.,dw,<val> \}
|
||||
struc du [val] \{ \common fields@struct equ fields@struct,.,du,<val> \}
|
||||
struc dd [val] \{ \common fields@struct equ fields@struct,.,dd,<val> \}
|
||||
struc dp [val] \{ \common fields@struct equ fields@struct,.,dp,<val> \}
|
||||
struc dq [val] \{ \common fields@struct equ fields@struct,.,dq,<val> \}
|
||||
struc dt [val] \{ \common fields@struct equ fields@struct,.,dt,<val> \}
|
||||
struc rb count \{ fields@struct equ fields@struct,.,db,count dup (?) \}
|
||||
struc rw count \{ fields@struct equ fields@struct,.,dw,count dup (?) \}
|
||||
struc rd count \{ fields@struct equ fields@struct,.,dd,count dup (?) \}
|
||||
struc rp count \{ fields@struct equ fields@struct,.,dp,count dup (?) \}
|
||||
struc rq count \{ fields@struct equ fields@struct,.,dq,count dup (?) \}
|
||||
struc rt count \{ fields@struct equ fields@struct,.,dt,count dup (?) \}
|
||||
macro db [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,db,<val> \}
|
||||
macro dw [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dw,<val> \}
|
||||
macro du [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,du,<val> \}
|
||||
macro dd [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dd,<val> \}
|
||||
macro dp [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dp,<val> \}
|
||||
macro dq [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dq,<val> \}
|
||||
macro dt [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dt,<val> \}
|
||||
macro rb count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,db,count dup (?) \}
|
||||
macro rw count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dw,count dup (?) \}
|
||||
macro rd count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dd,count dup (?) \}
|
||||
macro rp count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dp,count dup (?) \}
|
||||
macro rq count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dq,count dup (?) \}
|
||||
macro rt count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dt,count dup (?) \}
|
||||
macro union \{ fields@struct equ fields@struct,,union,<
|
||||
sub@struct equ union \}
|
||||
macro struct \{ fields@struct equ fields@struct,,substruct,<
|
||||
sub@struct equ substruct \}
|
||||
virtual at 0 }
|
||||
|
||||
macro ends
|
||||
{ match , sub@struct \{ restruc db,dw,du,dd,dp,dq,dt
|
||||
restruc rb,rw,rd,rp,rq,rt
|
||||
purge db,dw,du,dd,dp,dq,dt
|
||||
purge rb,rw,rd,rp,rq,rt
|
||||
purge union,struct
|
||||
match name=,fields,fields@struct \\{ fields@struct equ
|
||||
make@struct name,fields
|
||||
fields@\\#name equ fields \\}
|
||||
end virtual \}
|
||||
match any, sub@struct \{ fields@struct equ fields@struct> \}
|
||||
restore sub@struct }
|
||||
|
||||
macro make@struct name,[field,type,def]
|
||||
{ common
|
||||
if $
|
||||
display 'Error: definition of ',`name,' contains illegal instructions.',0Dh,0Ah
|
||||
err
|
||||
end if
|
||||
local define
|
||||
define equ name
|
||||
forward
|
||||
local sub
|
||||
match , field \{ make@substruct type,name,sub def
|
||||
define equ define,.,sub, \}
|
||||
match any, field \{ define equ define,.#field,type,<def> \}
|
||||
common
|
||||
match fields, define \{ define@struct fields \} }
|
||||
|
||||
macro define@struct name,[field,type,def]
|
||||
{ common
|
||||
local list
|
||||
list equ
|
||||
forward
|
||||
if ~ field eq .
|
||||
name#field type def
|
||||
sizeof.#name#field = $ - name#field
|
||||
else
|
||||
rb sizeof.#type
|
||||
end if
|
||||
local value
|
||||
match any, list \{ list equ list, \}
|
||||
list equ list <value>
|
||||
common
|
||||
sizeof.#name = $
|
||||
restruc name
|
||||
match values, list \{
|
||||
struc name value \\{
|
||||
match any, fields@struct \\\{ fields@struct equ fields@struct,.,name,<values> \\\}
|
||||
match , fields@struct \\\{ label .
|
||||
forward
|
||||
match , value \\\\{ field type def \\\\}
|
||||
match any, value \\\\{ field type value
|
||||
if ~ field eq .
|
||||
rb sizeof.#name#field - ($-field)
|
||||
end if \\\\}
|
||||
common \\\} \\} \} }
|
||||
|
||||
macro enable@substruct
|
||||
{ macro make@substruct substruct,parent,name,[field,type,def]
|
||||
\{ \common
|
||||
\local define
|
||||
define equ parent,name
|
||||
\forward
|
||||
\local sub
|
||||
match , field \\{ match any, type \\\{ enable@substruct
|
||||
make@substruct type,name,sub def
|
||||
purge make@substruct
|
||||
define equ define,.,sub, \\\} \\}
|
||||
match any, field \\{ define equ define,.\#field,type,<def> \\}
|
||||
\common
|
||||
match fields, define \\{ define@\#substruct fields \\} \} }
|
||||
|
||||
enable@substruct
|
||||
|
||||
macro define@union parent,name,[field,type,def]
|
||||
{ common
|
||||
virtual at 0
|
||||
forward
|
||||
if ~ field eq .
|
||||
virtual at 0
|
||||
parent#field type def
|
||||
sizeof.#parent#field = $ - parent#field
|
||||
end virtual
|
||||
if sizeof.#parent#field > $
|
||||
rb sizeof.#parent#field - $
|
||||
end if
|
||||
else if sizeof.#type > $
|
||||
rb sizeof.#type - $
|
||||
end if
|
||||
common
|
||||
sizeof.#name = $
|
||||
end virtual
|
||||
struc name [value] \{ \common
|
||||
label .\#name
|
||||
last@union equ
|
||||
forward
|
||||
match any, last@union \\{ virtual at .\#name
|
||||
field type def
|
||||
end virtual \\}
|
||||
match , last@union \\{ match , value \\\{ field type def \\\}
|
||||
match any, value \\\{ field type value \\\} \\}
|
||||
last@union equ field
|
||||
common rb sizeof.#name - ($ - .\#name) \} }
|
||||
|
||||
macro define@substruct parent,name,[field,type,def]
|
||||
{ common
|
||||
virtual at 0
|
||||
forward
|
||||
if ~ field eq .
|
||||
parent#field type def
|
||||
sizeof.#parent#field = $ - parent#field
|
||||
else
|
||||
rb sizeof.#type
|
||||
end if
|
||||
local value
|
||||
common
|
||||
sizeof.#name = $
|
||||
end virtual
|
||||
struc name value \{
|
||||
label .\#name
|
||||
forward
|
||||
match , value \\{ field type def \\}
|
||||
match any, value \\{ field type value
|
||||
if ~ field eq .
|
||||
rb sizeof.#parent#field - ($-field)
|
||||
end if \\}
|
||||
common \} }
|
Loading…
Reference in New Issue
Block a user