Rev 2054 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2054 | Rev 2134 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | #define false 0 |
31 | #define false 0 |
Line 32... | Line 32... | ||
32 | 32 | ||
33 | 33 | ||
34 | 34 | ||
35 | struct mouse{ |
35 | struct mouse{ |
Line -... | Line 36... | ||
- | 36 | unsigned int x,y,lkm,pkm,hor,vert; |
|
- | 37 | void get(); |
|
- | 38 | }; |
|
- | 39 | ||
- | 40 | int TestBit(EAX, CL) |
|
- | 41 | { |
|
36 | int x,y,lkm,pkm,hor,vert; |
42 | $shr eax,cl |
37 | void get(); |
43 | $and eax,1 |
38 | }; |
44 | } |
39 | 45 | ||
40 | void mouse::get() |
46 | void mouse::get() |
41 | { |
47 | { |
42 | EAX = 37; |
48 | EAX = 37; |
43 | EBX = 1; |
49 | EBX = 1; |
44 | $int 0x40 |
50 | $int 0x40 |
45 | $mov ebx, eax |
51 | $mov ebx, eax |
- | 52 | $shr eax, 16 |
|
46 | $shr eax, 16 |
53 | $and ebx,0x0000FFFF |
47 | $and ebx,0x0000FFFF |
54 | x = EAX; |
48 | x = EAX; |
55 | y = EBX; |
49 | y = EBX; |
56 | |
50 | EAX = 37; |
57 | EAX = 37; |
51 | EBX = 2; |
58 | EBX = 2; |
52 | $int 0x40 |
59 | $int 0x40 |
53 | $mov ebx, eax |
60 | $mov ebx, eax |
54 | $and eax, 0x00000001 |
61 | $and eax, 0x00000001 |
- | 62 | $shr ebx, 1 |
|
55 | $shr ebx, 1 |
63 | $and ebx, 0x00000001 |
56 | $and ebx, 0x00000001 |
64 | lkm = EAX; |
57 | lkm = EAX; |
65 | pkm = EBX; |
58 | pkm = EBX; |
66 | |
59 | EAX = 37; //áªà®«« |
67 | EAX = 37; //scroll |
60 | EBX = 7; |
68 | EBX = 7; |
Line 79... | Line 87... | ||
79 | void GetInfo(dword ECX); |
87 | void GetInfo(dword ECX); |
80 | byte reserved[1024-71]; |
88 | byte reserved[1024-71]; |
81 | #define SelfInfo -1 |
89 | #define SelfInfo -1 |
82 | }; |
90 | }; |
Line 83... | Line 91... | ||
83 | 91 | ||
84 | void proc_info::GetInfo(dword ECX) |
92 | void proc_info::GetInfo(dword EBX, ECX) |
85 | { |
93 | { |
86 | EAX = 9; |
- | |
87 | EBX = #use_cpu; |
94 | EAX = 9; |
88 | $int 0x40 |
95 | $int 0x40 |
- | 96 | } |
|
- | 97 | ||
- | 98 | int GetSlot(dword ECX) |
|
- | 99 | { |
|
- | 100 | EAX = 18; |
|
- | 101 | EBX = 21; |
|
- | 102 | $int 0x40 |
|
- | 103 | } |
|
- | 104 | ||
- | 105 | int ActiveProcess() |
|
- | 106 | { |
|
- | 107 | EAX = 18; |
|
- | 108 | EBX = 7; |
|
- | 109 | $int 0x40 |
|
- | 110 | } |
|
89 | } |
111 | |
Line 90... | Line 112... | ||
90 | //------------------------------------------------------------------------------- |
112 | //------------------------------------------------------------------------------- |
91 | 113 | ||
92 | inline fastcall dword WaitEvent(){ |
114 | inline fastcall dword WaitEvent(){ |
Line 98... | Line 120... | ||
98 | { |
120 | { |
99 | EAX = 40; |
121 | EAX = 40; |
100 | $int 0x40 |
122 | $int 0x40 |
101 | } |
123 | } |
Line 102... | Line 124... | ||
102 | 124 | ||
- | 125 | inline fastcall word GetKey(){ //Gluk fix |
|
- | 126 | $push edx |
|
103 | inline fastcall word GetKey(){ |
127 | @getkey: |
104 | EAX = 2; // just read this key from buffer |
128 | $mov eax,2 |
- | 129 | $int 0x40 |
|
- | 130 | $cmp eax,1 |
|
- | 131 | $jne getkeyi |
|
- | 132 | $mov ah,dh |
|
- | 133 | $jmp getkeyii //jz? |
|
- | 134 | @getkeyi: |
|
- | 135 | $mov dh,ah |
|
- | 136 | $jmp getkey |
|
- | 137 | @getkeyii: |
|
105 | $int 0x40 |
138 | $pop edx |
106 | EAX = EAX >> 8; |
139 | EAX = EAX >> 8; |
Line 107... | Line 140... | ||
107 | } |
140 | } |
108 | 141 | ||
Line 147... | Line 180... | ||
147 | $int 0x40; |
180 | $int 0x40; |
148 | } |
181 | } |
Line 149... | Line 182... | ||
149 | 182 | ||
150 | 183 | ||
151 | inline fastcall void WindowRedrawStatus(dword EBX){ |
184 | inline fastcall void WindowRedrawStatus(dword EBX){ |
152 | EAX = 12; //tell os about windowdraw |
185 | EAX = 12; |
Line 153... | Line 186... | ||
153 | $int 0x40 |
186 | $int 0x40 |
154 | } |
187 | } |
Line 186... | Line 219... | ||
186 | $stosb |
219 | $stosb |
187 | $test al,al |
220 | $test al,al |
188 | $jnz l1 |
221 | $jnz l1 |
189 | } |
222 | } |
Line 190... | Line -... | ||
190 | - | ||
191 | byte fastcall TestBit(EAX, CL) |
- | |
192 | { |
- | |
193 | $shr eax,cl |
- | |
194 | $and eax,1 |
- | |
195 | } |
- | |
196 | - | ||
197 | 223 | ||
198 | char buffer[11]=""; |
224 | char buffer[11]=""; |
199 | inline fastcall dword IntToStr(dword ESI) |
225 | inline fastcall dword IntToStr(dword ESI) |
200 | { |
226 | { |
201 | $mov edi, #buffer |
227 | $mov edi, #buffer |
Line 221... | Line 247... | ||
221 | $jnz f3 |
247 | $jnz f3 |
222 | $mov eax, #buffer |
248 | $mov eax, #buffer |
223 | $ret |
249 | $ret |
224 | } |
250 | } |
Line 225... | Line -... | ||
225 | - | ||
226 | - | ||
227 | dword StrToCol(char* htmlcolor) |
- | |
228 | { |
- | |
229 | dword j=1, color=0; char ch=0x00; |
- | |
230 | IF (ESBYTE[htmlcolor]<>'#') RETURN; |
- | |
231 | FOR (;j<7;j++) |
- | |
232 | { |
- | |
233 | ch=ESBYTE[htmlcolor+j]; |
- | |
234 | IF ((ch>='0') && (ch<='9')) ch -= '0'; |
- | |
235 | IF ((ch>='A') && (ch<='F')) ch -= 'A'-10; |
- | |
236 | IF ((ch>='a') && (ch<='f')) ch -= 'a'-10; |
- | |
237 | color = color*0x10 + ch; |
- | |
238 | } |
- | |
239 | EAX=color; |
- | |
240 | } |
- | |
241 | - | ||
242 | 251 | ||
243 | inline fastcall int strcmp(ESI, EDI) |
252 | inline fastcall int strcmp(ESI, EDI) |
244 | { |
253 | { |
245 | loop() |
254 | loop() |
246 | { |
255 | { |
Line 330... | Line 339... | ||
330 | void DrawFlatButton(dword x,y,width,height,id,color,text) |
339 | void DrawFlatButton(dword x,y,width,height,id,color,text) |
331 | { |
340 | { |
332 | DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE); |
341 | DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE); |
333 | DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7); |
342 | DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7); |
334 | DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª |
343 | DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª |
335 | IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //ª®¯ª |
344 | IF (id<>0) DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF); //ª®¯ª |
336 | WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0); |
345 | WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0); |
337 | } |
346 | } |
Line 338... | Line 347... | ||
338 | 347 | ||
339 | void PutImage(dword EBX,w,h,x,y) |
348 | void PutPaletteImage(dword EBX,w,h,x,y, EDI) |
340 | { |
349 | { |
341 | EAX = 7; |
350 | EAX = 65; |
342 | ECX = w<<16+h; |
351 | ECX = w<<16+h; |
- | 352 | EDX = x<<16+y; |
|
- | 353 | ESI = 8; |
|
343 | EDX = x<<16+y; |
354 | EBP = 0; |
344 | $int 0x40 |
355 | $int 0x40 |
Line 345... | Line 356... | ||
345 | } |
356 | } |
346 | 357 | ||
347 | void PutPaletteImage(dword EBX,w,h,x,y, EDI) |
358 | void PutImage(dword EBX,w,h,x,y) |
348 | { |
359 | { |
349 | EAX = 65; |
360 | EAX = 7; |
350 | ECX = w<<16+h; |
- | |
351 | EDX = x<<16+y; |
- | |
352 | ESI = 8; |
361 | ECX = w<<16+h; |
353 | EBP = 0; |
362 | EDX = x<<16+y; |
Line 354... | Line 363... | ||
354 | $int 0x40 |
363 | $int 0x40 |
355 | } |
364 | } |
356 | 365 | ||
357 | //------------------------------------------------------------------------------ |
366 | //------------------------------------------------------------------------------ |
358 | void WriteDebug(dword EDX) |
367 | /*void WriteDebug(dword EDX) |
359 | { |
368 | { |
360 | $mov eax, 63 |
369 | $mov eax, 63 |
Line 370... | Line 379... | ||
370 | $mov cl, 13 |
379 | $mov cl, 13 |
371 | $int 0x40 |
380 | $int 0x40 |
372 | $mov cl, 10 |
381 | $mov cl, 10 |
373 | $int 0x40 |
382 | $int 0x40 |
374 | }16+y; |
383 | } |
- | 384 | ||
- | 385 | inline fastcall void WriteFullDebug(dword ESI) |
|
- | 386 | { |
|
- | 387 | WriteDebug(""); |
|
- | 388 | WriteDebug(ESI); |
|
- | 389 | ||
- | 390 | WriteDebug("Number of files:"); |
|
- | 391 | WriteDebug(IntToStr(count)); |
|
- | 392 | ||
- | 393 | WriteDebug("but_num:"); |
|
- | 394 | WriteDebug(IntToStr(but_num)); |
|
- | 395 | ||
- | 396 | WriteDebug("curbtn"); |
|
- | 397 | WriteDebug(IntToStr(curbtn)); |
|
- | 398 | ||
- | 399 | WriteDebug("ra_kadrom:"); |
|
- | 400 | WriteDebug(IntToStr(za_kadrom)); |
|
- | 401 | ||
- | 402 | Pause(200); |
|
- | 403 | }*/16+y; |
|
375 | ><16+y; |
404 | ><16+y; |