Subversion Repositories Kolibri OS

Rev

Rev 617 | Rev 1937 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 617 Rev 1567
Line 180... Line 180...
180
 }
180
 }
Line 181... Line 181...
181
 
181
 
182
 
182
 
183
 
183
 
184
; strings
184
; strings
185
macro sz name,[data] {	     ; from MFAR [mike.dld]
185
macro sz name,[data] {       ; from MFAR [mike.dld]
186
 common
186
 common
187
  if used name
187
  if used name
188
   name db data
188
   name db data
Line -... Line 189...
-
 
189
   .size = $-name
-
 
190
  end if
-
 
191
}
-
 
192
 
-
 
193
macro szZ name,[data] {      ; same as sz, but with 0 at the end of line (ASCIIZ string) [dunkaist]
-
 
194
 common
-
 
195
  if used name
-
 
196
   name db data,0
-
 
197
   .size = $-name-1
189
   .size = $-name
198
  end if
190
  end if
199
}
191
}
200
sz0 fix szZ
192
 
201
 
193
macro lsz name,[lng,data] {  ; from MFAR [mike.dld]
202
macro lsz name,[lng,data] {  ; from MFAR [mike.dld]
Line 201... Line 210...
201
 common
210
 common
202
   .size = $-name
211
   .size = $-name
203
  end if
212
  end if
204
}
213
}
Line 205... Line 214...
205
 
214
 
206
macro szc name,elsz,[data] {	     ; from MFAR [mike.dld]
215
macro szc name,elsz,[data] {         ; from MFAR [mike.dld]
207
 common
216
 common
208
  local s,m
217
  local s,m
209
  m = 0
218
  m = 0
210
  if used name
219
  if used name
Line 268... Line 277...
268
      add dest, lsrc
277
      add dest, lsrc
269
    end if
278
    end if
270
  end if
279
  end if
271
}
280
}
Line 272... Line 281...
272
 
281
 
273
macro __mov reg,a,b {	    ; mike.dld
282
macro __mov reg,a,b {       ; mike.dld
274
 if (~a eq)&(~b eq)
283
 if (~a eq)&(~b eq)
275
   mpack reg,a,b
284
   mpack reg,a,b
276
 else if (~a eq)&(b eq)
285
 else if (~a eq)&(b eq)
277
   mov reg,a
286
   mov reg,a
278
 end if
287
 end if
Line 279... Line 288...
279
}
288
}
280
 
289
 
281
 
290
 
Line 282... Line 291...
282
include 'config.inc'
291
include 'config.inc'
283
;__CPU_type	equ	p5
292
;__CPU_type equ p5
284
SYSENTER_VAR	equ	0
293
SYSENTER_VAR    equ 0
285
 
294
 
286
macro mcall a,b,c,d,e,f {   ; mike.dld, updated by Ghost for Fast System Calls
295
macro mcall a,b,c,d,e,f {   ; mike.dld, updated by Ghost for Fast System Calls
287
 local	..ret_point
296
 local  ..ret_point
288
 __mov eax,a
297
 __mov eax,a
289
 __mov ebx,b
298
 __mov ebx,b
Line 290... Line 299...
290
 __mov ecx,c
299
 __mov ecx,c
291
 __mov edx,d
300
 __mov edx,d
292
 __mov esi,e
301
 __mov esi,e
293
 __mov edi,f
302
 __mov edi,f
294
 
303
 
295
 if __CPU_type eq p5
304
 if __CPU_type eq p5
296
	int	0x40
305
    int 0x40
297
 else
306
 else
298
  if __CPU_type eq p6
307
  if __CPU_type eq p6
299
	push	ebp
308
    push    ebp
300
	mov	ebp, esp
309
    mov ebp, esp
Line 301... Line 310...
301
	push	..ret_point	; it may be 2 or 5 byte
310
    push    ..ret_point ; it may be 2 or 5 byte
302
	sysenter
311
    sysenter
303
 ..ret_point:
312
 ..ret_point:
304
	pop	edx
313
    pop edx
305
	pop	ecx
314
    pop ecx
306
 
315
 
307
  else
316
  else
308
   if __CPU_type eq k6
317
   if __CPU_type eq k6
309
	push	ecx
318
    push    ecx
310
	syscall
319
    syscall
311
	pop	ecx
320
    pop ecx
312
   else
321
   else
313
	display 'ERROR : unknown CPU type (set to p5)', 10, 13
322
    display 'ERROR : unknown CPU type (set to p5)', 10, 13
Line 391... Line 400...
391
 
400
 
392
macro add arg1,arg2
401
macro add arg1,arg2
393
 {
402
 {
394
   if (arg2 eqtype 0)
403
   if (arg2 eqtype 0)
395
      if (arg2) = 1
404
      if (arg2) = 1
396
	 inc arg1
405
     inc arg1
397
      else
406
      else
398
	 add arg1,arg2
407
     add arg1,arg2
399
      end if
408
      end if
400
   else
409
   else
401
      add arg1,arg2
410
      add arg1,arg2
402
   end if
411
   end if
Line 403... Line 412...
403
 }
412
 }
404
 
413
 
405
macro sub arg1,arg2
414
macro sub arg1,arg2
406
 {
415
 {
407
   if (arg2 eqtype 0)
416
   if (arg2 eqtype 0)
408
      if (arg2) = 1
417
      if (arg2) = 1
409
	 dec arg1
418
     dec arg1
410
      else
419
      else
411
	 sub arg1,arg2
420
     sub arg1,arg2
412
      end if
421
      end if
413
   else
422
   else
414
      sub arg1,arg2
423
      sub arg1,arg2
Line 415... Line 424...
415
   end if
424
   end if
416
 }
425
 }
417
 
426
 
418
macro mov arg1,arg2
427
macro mov arg1,arg2
419
 {
428
 {
420
   if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
429
   if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
421
      if (arg2) = 0
430
      if (arg2) = 0
422
	 xor arg1,arg1
431
     xor arg1,arg1
423
      else if (arg2) = 1
432
      else if (arg2) = 1
424
	 xor arg1,arg1
433
     xor arg1,arg1
425
	 inc arg1
434
     inc arg1
426
      else if (arg2) = -1
435
      else if (arg2) = -1
427
	 or  arg1,-1
436
     or  arg1,-1
428
      else if (arg2) > -128 & (arg2) < 128
437
      else if (arg2) > -128 & (arg2) < 128
429
	 push arg2
438
     push arg2
430
	 pop  arg1
439
     pop  arg1
431
      else
440
      else
432
	 mov  arg1,arg2
441
     mov  arg1,arg2
433
      end if
442
      end if
434
   else
443
   else
Line 452... Line 461...
452
 
461
 
453
; structure definition helper
462
; structure definition helper
Line 454... Line 463...
454
include 'struct.inc'
463
include 'struct.inc'
455
 
464
 
456
struct RECT
465
struct RECT
457
  left	 dd ?
466
  left   dd ?
458
  top	 dd ?
467
  top    dd ?
459
  right  dd ?
468
  right  dd ?
Line 460... Line 469...
460
  bottom dd ?
469
  bottom dd ?
461
ends
470
ends
462
 
471
 
463
struct BOX
472
struct BOX
464
  left	 dd ?
473
  left   dd ?
465
  top	 dd ?
474
  top    dd ?
Line 466... Line 475...
466
  width  dd ?
475
  width  dd ?
467
  height dd ?
476
  height dd ?
468
ends
477
ends
469
 
478
 
470
; structures used in MeOS
479
; structures used in MeOS
471
struct process_information
480
struct process_information
472
  cpu_usage		  dd ?	; +0
481
  cpu_usage       dd ?  ; +0
473
  window_stack_position   dw ?	; +4
482
  window_stack_position   dw ?  ; +4
474
  window_stack_value	  dw ?	; +6
483
  window_stack_value      dw ?  ; +6
475
			  dw ?	; +8
484
              dw ?  ; +8
476
  process_name		  rb 12 ; +10
485
  process_name        rb 12 ; +10
477
  memory_start		  dd ?	; +22
486
  memory_start        dd ?  ; +22
478
  used_memory		  dd ?	; +26
487
  used_memory         dd ?  ; +26
479
  PID			  dd ?	; +30
488
  PID             dd ?  ; +30
480
  box			  BOX	; +34
489
  box             BOX   ; +34
481
  slot_state		  dw ?	; +50
490
  slot_state          dw ?  ; +50
482
			  dw ?	; +52
491
              dw ?  ; +52
Line 483... Line 492...
483
  client_box		  BOX	; +54
492
  client_box          BOX   ; +54
484
  wnd_state               db ?  ; +70
493
  wnd_state               db ?  ; +70
485
  rb (1024-71)
494
  rb (1024-71)
486
ends
495
ends
487
 
496
 
488
struct system_colors
497
struct system_colors
489
  frame 	   dd ?
498
  frame        dd ?
490
  grab		   dd ?
499
  grab         dd ?
491
  grab_button	   dd ?
500
  grab_button      dd ?
492
  grab_button_text dd ?
501
  grab_button_text dd ?
493
  grab_text	   dd ?
502
  grab_text    dd ?
494
  work		   dd ?
503
  work         dd ?
Line 495... Line 504...
495
  work_button	   dd ?
504
  work_button      dd ?
496
  work_button_text dd ?
505
  work_button_text dd ?
497
  work_text	   dd ?
506
  work_text    dd ?
498
  work_graph	   dd ?
507
  work_graph       dd ?
499
ends
508
ends
500
 
509
 
501
struct FILEDATE
510
struct FILEDATE
502
  Second db ?
511
  Second db ?
503
  Minute db ?
512
  Minute db ?
Line 504... Line 513...
504
  Hour	 db ?
513
  Hour   db ?
505
	 db ?
514
     db ?
506
  Day	 db ?
515
  Day    db ?
507
  Month  db ?
516
  Month  db ?
508
  Year	 dw ?
517
  Year   dw ?
509
ends
518
ends
510
 
519
 
511
struct FILEINFO
520
struct FILEINFO
512
  Attributes dd ?
521
  Attributes dd ?
Line 513... Line 522...
513
  IsUnicode  db ?
522
  IsUnicode  db ?
Line 514... Line 523...
514
	     db 3 dup(?)
523
         db 3 dup(?)
515
  DateCreate FILEDATE
524
  DateCreate FILEDATE
516
  DateAccess FILEDATE
525
  DateAccess FILEDATE
517
  DateModify FILEDATE
526
  DateModify FILEDATE
518
  Size	     dq ?
527
  Size       dq ?
519
ends
528
ends
520
 
529
 
521
; constants
530
; constants
522
 
531
 
523
; events
532
; events
524
EV_IDLE        = 0
533
EV_IDLE        = 0
Line 525... Line 534...
525
EV_TIMER       = 0
534
EV_TIMER       = 0
526
EV_REDRAW      = 1
535
EV_REDRAW      = 1
527
EV_KEY	       = 2
536
EV_KEY         = 2
528
EV_BUTTON      = 3
537
EV_BUTTON      = 3
529
EV_EXIT        = 4
538
EV_EXIT        = 4
530
EV_BACKGROUND  = 5
539
EV_BACKGROUND  = 5
531
EV_MOUSE       = 6
540
EV_MOUSE       = 6