2012-03-22 14:33:15 +01:00
|
|
|
|
//CODED by Veliant, Leency 2008-2012. GNU GPL licence.
|
2010-12-19 08:29:49 +01:00
|
|
|
|
|
|
|
|
|
#startaddress 0
|
|
|
|
|
#code32 TRUE
|
|
|
|
|
|
|
|
|
|
byte os_name[8] = {'M','E','N','U','E','T','0','1'};
|
|
|
|
|
dword os_version = 0x00000001;
|
|
|
|
|
dword start_addr = #main;
|
|
|
|
|
dword final_addr = #stop+32;
|
2013-01-09 01:09:59 +01:00
|
|
|
|
dword alloc_mem = 0x000f0000;
|
|
|
|
|
dword x86esp_reg = 0x000f0000;
|
2010-12-19 08:29:49 +01:00
|
|
|
|
dword I_Param = #param;
|
2011-08-18 15:32:06 +02:00
|
|
|
|
dword I_Path = #program_path;
|
2011-10-05 11:50:43 +02:00
|
|
|
|
|
2012-04-05 00:18:49 +02:00
|
|
|
|
char param[4096];
|
|
|
|
|
char program_path[4096];
|
2011-08-18 15:32:06 +02:00
|
|
|
|
|
2012-11-15 23:03:43 +01:00
|
|
|
|
#include "lib\strings.h"
|
2010-12-19 08:29:49 +01:00
|
|
|
|
|
|
|
|
|
//Events
|
|
|
|
|
#define evMouse 6
|
|
|
|
|
#define evButton 3
|
|
|
|
|
#define evKey 2
|
|
|
|
|
#define evReDraw 1
|
|
|
|
|
|
|
|
|
|
//Button options
|
|
|
|
|
#define BT_DEL 0x80000000
|
|
|
|
|
#define BT_HIDE 0x40000000
|
|
|
|
|
#define BT_NOFRAME 0x20000000
|
|
|
|
|
|
|
|
|
|
#define OLD -1
|
|
|
|
|
#define true 1
|
|
|
|
|
#define false 0
|
|
|
|
|
|
2012-11-12 19:56:19 +01:00
|
|
|
|
#define NULL 0
|
2010-12-19 08:29:49 +01:00
|
|
|
|
|
|
|
|
|
|
2012-06-21 00:51:10 +02:00
|
|
|
|
struct mouse
|
|
|
|
|
{
|
2011-08-27 23:37:45 +02:00
|
|
|
|
unsigned int x,y,lkm,pkm,hor,vert;
|
|
|
|
|
void get();
|
2010-12-19 08:29:49 +01:00
|
|
|
|
};
|
|
|
|
|
|
2011-10-05 11:50:43 +02:00
|
|
|
|
inline fastcall int TestBit(EAX, CL)
|
2011-08-27 23:37:45 +02:00
|
|
|
|
{
|
|
|
|
|
$shr eax,cl
|
|
|
|
|
$and eax,1
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-19 08:29:49 +01:00
|
|
|
|
void mouse::get()
|
|
|
|
|
{
|
|
|
|
|
EAX = 37;
|
|
|
|
|
EBX = 1;
|
|
|
|
|
$int 0x40
|
|
|
|
|
$mov ebx, eax
|
|
|
|
|
$shr eax, 16
|
|
|
|
|
$and ebx,0x0000FFFF
|
|
|
|
|
x = EAX;
|
|
|
|
|
y = EBX;
|
2011-08-27 23:37:45 +02:00
|
|
|
|
|
2010-12-19 08:29:49 +01:00
|
|
|
|
EAX = 37;
|
|
|
|
|
EBX = 2;
|
|
|
|
|
$int 0x40
|
|
|
|
|
$mov ebx, eax
|
|
|
|
|
$and eax, 0x00000001
|
|
|
|
|
$shr ebx, 1
|
|
|
|
|
$and ebx, 0x00000001
|
|
|
|
|
lkm = EAX;
|
|
|
|
|
pkm = EBX;
|
2011-08-27 23:37:45 +02:00
|
|
|
|
|
|
|
|
|
EAX = 37; //scroll
|
2010-12-19 08:29:49 +01:00
|
|
|
|
EBX = 7;
|
|
|
|
|
$int 0x40
|
|
|
|
|
$mov ebx, eax
|
|
|
|
|
$shr eax, 16
|
|
|
|
|
$and ebx,0x0000FFFF
|
|
|
|
|
//hor = EAX;
|
|
|
|
|
vert = EBX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
2012-06-21 00:51:10 +02:00
|
|
|
|
struct proc_info
|
|
|
|
|
{
|
|
|
|
|
#define SelfInfo -1
|
2010-12-19 08:29:49 +01:00
|
|
|
|
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;
|
2012-12-17 01:11:34 +01:00
|
|
|
|
dword cwidth,cheight;
|
|
|
|
|
byte reserved[1024-71-8];
|
2010-12-19 08:29:49 +01:00
|
|
|
|
};
|
|
|
|
|
|
2012-12-17 01:11:34 +01:00
|
|
|
|
inline fastcall void GetProcessInfo( EBX, ECX)
|
2010-12-19 08:29:49 +01:00
|
|
|
|
{
|
2012-06-21 00:51:10 +02:00
|
|
|
|
$mov eax,9;
|
2012-12-17 01:11:34 +01:00
|
|
|
|
$int 0x40
|
|
|
|
|
DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth
|
|
|
|
|
DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight
|
2010-12-19 08:29:49 +01:00
|
|
|
|
}
|
2011-08-27 23:37:45 +02:00
|
|
|
|
|
2012-06-21 00:51:10 +02:00
|
|
|
|
inline fastcall int GetSlot( ECX)
|
2011-08-27 23:37:45 +02:00
|
|
|
|
{
|
2012-06-21 00:51:10 +02:00
|
|
|
|
$mov eax,18;
|
|
|
|
|
$mov ebx,21;
|
2011-08-27 23:37:45 +02:00
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-15 15:11:03 +01:00
|
|
|
|
inline fastcall int GetActiveProcess()
|
2011-08-27 23:37:45 +02:00
|
|
|
|
{
|
2012-06-21 00:51:10 +02:00
|
|
|
|
$mov eax,18;
|
|
|
|
|
$mov ebx,7;
|
2011-08-27 23:37:45 +02:00
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-15 15:11:03 +01:00
|
|
|
|
inline fastcall void ActivateWindow( ECX)
|
|
|
|
|
{
|
|
|
|
|
EAX = 18;
|
|
|
|
|
EBX = 3;
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-19 08:29:49 +01:00
|
|
|
|
//-------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
inline fastcall dword WaitEvent(){
|
2012-06-21 00:51:10 +02:00
|
|
|
|
$mov eax,10;
|
2011-08-27 23:37:45 +02:00
|
|
|
|
$int 0x40
|
2010-12-19 08:29:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-21 00:51:10 +02:00
|
|
|
|
inline fastcall void SetEventMask( EBX)
|
2010-12-19 08:29:49 +01:00
|
|
|
|
{
|
2011-08-27 23:37:45 +02:00
|
|
|
|
EAX = 40;
|
|
|
|
|
$int 0x40
|
2010-12-19 08:29:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-21 00:51:10 +02:00
|
|
|
|
inline fastcall word GetKey(){ //+Gluk fix
|
2011-08-27 23:37:45 +02:00
|
|
|
|
$push edx
|
2012-12-15 15:11:03 +01:00
|
|
|
|
GETKEY:
|
2011-08-27 23:37:45 +02:00
|
|
|
|
$mov eax,2
|
|
|
|
|
$int 0x40
|
|
|
|
|
$cmp eax,1
|
2012-12-15 15:11:03 +01:00
|
|
|
|
$jne GETKEYI
|
2011-08-27 23:37:45 +02:00
|
|
|
|
$mov ah,dh
|
2012-12-15 15:11:03 +01:00
|
|
|
|
$jmp GETKEYII //jz?
|
|
|
|
|
GETKEYI:
|
2011-08-27 23:37:45 +02:00
|
|
|
|
$mov dh,ah
|
2012-12-15 15:11:03 +01:00
|
|
|
|
$jmp GETKEY
|
|
|
|
|
GETKEYII:
|
2011-08-27 23:37:45 +02:00
|
|
|
|
$pop edx
|
|
|
|
|
EAX = EAX >> 8;
|
2010-12-19 08:29:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline fastcall word GetButtonID(){
|
2011-08-27 23:37:45 +02:00
|
|
|
|
EAX = 17; // Get ID
|
|
|
|
|
$int 0x40
|
|
|
|
|
EAX = EAX >> 8;
|
2010-12-19 08:29:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline fastcall void ExitProcess(){
|
2011-08-27 23:37:45 +02:00
|
|
|
|
EAX = -1; // close this program
|
|
|
|
|
$int 0x40
|
2010-12-19 08:29:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
2012-07-16 13:58:24 +02:00
|
|
|
|
inline fastcall void Pause( EBX){
|
2012-06-21 00:51:10 +02:00
|
|
|
|
$mov eax, 5
|
2010-12-19 08:29:49 +01:00
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2012-07-16 13:58:24 +02:00
|
|
|
|
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType, dword mainAreaColour, EDI)
|
2010-12-19 08:29:49 +01:00
|
|
|
|
{
|
2011-10-05 11:50:43 +02:00
|
|
|
|
EAX = 12; // function 12:tell os about windowdraw
|
2011-09-26 16:44:58 +02:00
|
|
|
|
EBX = 1;
|
|
|
|
|
$int 0x40
|
2011-09-26 16:30:45 +02:00
|
|
|
|
|
2010-12-19 08:29:49 +01:00
|
|
|
|
EBX = x << 16 + sizeX;
|
|
|
|
|
ECX = y << 16 + sizeY;
|
2011-10-05 11:50:43 +02:00
|
|
|
|
EDX = mainAreaType << 24 | mainAreaColour;
|
2010-12-19 08:29:49 +01:00
|
|
|
|
$xor eax,eax
|
|
|
|
|
$int 0x40
|
2011-10-05 11:50:43 +02:00
|
|
|
|
|
|
|
|
|
EAX = 12; // function 12:tell os about windowdraw
|
2011-09-26 16:44:58 +02:00
|
|
|
|
EBX = 2;
|
|
|
|
|
$int 0x40
|
2010-12-19 08:29:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-21 00:51:10 +02:00
|
|
|
|
inline fastcall void CreateThread( ECX,EDX)
|
2010-12-19 08:29:49 +01:00
|
|
|
|
{
|
|
|
|
|
EAX = 51;
|
|
|
|
|
EBX = 1;
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-21 00:51:10 +02:00
|
|
|
|
inline fastcall void DrawTitle( ECX){
|
2010-12-19 08:29:49 +01:00
|
|
|
|
EAX = 71;
|
|
|
|
|
EBX = 1;
|
|
|
|
|
$int 0x40;
|
|
|
|
|
}
|
|
|
|
|
|
2012-07-16 13:58:24 +02:00
|
|
|
|
inline fastcall dword GetSkinHeight()
|
|
|
|
|
{
|
|
|
|
|
$push ebx
|
|
|
|
|
$mov eax,48
|
|
|
|
|
$mov ebx,4
|
2010-12-19 08:29:49 +01:00
|
|
|
|
$int 0x40
|
2012-07-16 13:58:24 +02:00
|
|
|
|
$pop ebx
|
2010-12-19 08:29:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
2012-05-13 02:30:49 +02:00
|
|
|
|
inline fastcall dword GetScreenHeight()
|
|
|
|
|
{
|
|
|
|
|
EAX = 14;
|
|
|
|
|
$int 0x40
|
|
|
|
|
$and eax,0x0000FFFF
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-15 15:11:03 +01:00
|
|
|
|
inline fastcall dword GetScreenWidth()
|
|
|
|
|
{
|
|
|
|
|
$mov eax, 14
|
|
|
|
|
$int 0x40
|
|
|
|
|
$shr eax, 16
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-21 00:51:10 +02:00
|
|
|
|
inline fastcall void MoveSize( EBX,ECX,EDX,ESI){
|
|
|
|
|
$mov eax,67;
|
2010-12-19 08:29:49 +01:00
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2012-06-21 00:51:10 +02:00
|
|
|
|
inline fastcall void PutPixel( EBX,ECX,EDX)
|
|
|
|
|
{
|
2010-12-19 08:29:49 +01:00
|
|
|
|
EAX=1;
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
2012-03-30 12:14:05 +02:00
|
|
|
|
void DefineButton(dword x,y,w,h,EDX,ESI)
|
|
|
|
|
{
|
|
|
|
|
EAX = 8;
|
|
|
|
|
$push edx
|
|
|
|
|
EDX += BT_DEL; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20><>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
$int 0x40;
|
2010-12-19 08:29:49 +01:00
|
|
|
|
EBX = x<<16+w;
|
|
|
|
|
ECX = y<<16+h;
|
2012-03-30 12:14:05 +02:00
|
|
|
|
$pop edx
|
2010-12-19 08:29:49 +01:00
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-21 00:51:10 +02:00
|
|
|
|
inline fastcall void DeleteButton( EDX)
|
2010-12-19 08:29:49 +01:00
|
|
|
|
{
|
|
|
|
|
EAX = 8;
|
|
|
|
|
EDX += BT_DEL;
|
|
|
|
|
$int 0x40;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
|
|
|
|
|
{
|
|
|
|
|
EAX = 4;
|
|
|
|
|
EBX = x<<16+y;
|
|
|
|
|
ECX = fontType<<24+color;
|
|
|
|
|
$int 0x40;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrawBar(dword x,y,w,h,EDX)
|
|
|
|
|
{
|
2012-12-17 01:11:34 +01:00
|
|
|
|
if (h<0) || (h>8000) return;
|
2010-12-19 08:29:49 +01:00
|
|
|
|
EAX = 13;
|
|
|
|
|
EBX = x<<16+w;
|
|
|
|
|
ECX = y<<16+h;
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrawRegion_3D(dword x,y,width,height,color1,color2)
|
|
|
|
|
{
|
2012-06-21 00:51:10 +02:00
|
|
|
|
DrawBar(x,y,width+1,1,color1);
|
|
|
|
|
DrawBar(x,y+1,1,height-1,color1);
|
|
|
|
|
DrawBar(x+width,y+1,1,height,color2);
|
|
|
|
|
DrawBar(x,y+height,width,1,color2);
|
2010-12-19 08:29:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
2011-08-27 23:37:45 +02:00
|
|
|
|
void PutPaletteImage(dword EBX,w,h,x,y, EDI)
|
2010-12-19 08:29:49 +01:00
|
|
|
|
{
|
2011-08-27 23:37:45 +02:00
|
|
|
|
EAX = 65;
|
2010-12-19 08:29:49 +01:00
|
|
|
|
ECX = w<<16+h;
|
|
|
|
|
EDX = x<<16+y;
|
2011-08-27 23:37:45 +02:00
|
|
|
|
ESI = 8;
|
|
|
|
|
EBP = 0;
|
2010-12-19 08:29:49 +01:00
|
|
|
|
$int 0x40
|
2011-08-27 23:37:45 +02:00
|
|
|
|
}
|
2010-12-19 08:29:49 +01:00
|
|
|
|
|
2011-08-27 23:37:45 +02:00
|
|
|
|
void PutImage(dword EBX,w,h,x,y)
|
2010-12-19 08:29:49 +01:00
|
|
|
|
{
|
2011-08-27 23:37:45 +02:00
|
|
|
|
EAX = 7;
|
2010-12-19 08:29:49 +01:00
|
|
|
|
ECX = w<<16+h;
|
|
|
|
|
EDX = x<<16+y;
|
|
|
|
|
$int 0x40
|
2011-08-27 23:37:45 +02:00
|
|
|
|
}
|
2010-12-19 08:29:49 +01:00
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2012-06-21 00:51:10 +02:00
|
|
|
|
inline fastcall void debug( EDX)
|
2010-12-19 08:29:49 +01:00
|
|
|
|
{
|
|
|
|
|
$mov eax, 63
|
|
|
|
|
$mov ebx, 1
|
2012-12-15 15:11:03 +01:00
|
|
|
|
NEXT_CHAR:
|
2010-12-19 08:29:49 +01:00
|
|
|
|
$mov ecx, DSDWORD[edx]
|
|
|
|
|
$or cl, cl
|
2012-12-15 15:11:03 +01:00
|
|
|
|
$jz DONE
|
2010-12-19 08:29:49 +01:00
|
|
|
|
$int 0x40
|
|
|
|
|
$inc edx
|
2012-12-15 15:11:03 +01:00
|
|
|
|
$jmp NEXT_CHAR
|
|
|
|
|
DONE:
|
2010-12-19 08:29:49 +01:00
|
|
|
|
$mov cl, 13
|
|
|
|
|
$int 0x40
|
|
|
|
|
$mov cl, 10
|
|
|
|
|
$int 0x40
|
2011-10-05 11:50:43 +02:00
|
|
|
|
}
|