Subversion Repositories Kolibri OS

Rev

Rev 9527 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9527 Rev 10059
Line 81... Line 81...
81
	ret
81
	ret
82
;------------------------------------------------------------------------------
82
;------------------------------------------------------------------------------
83
align 4
83
align 4
84
START:		       ; start of execution
84
START:		       ; start of execution
85
	mcall	68,11
85
	mcall	68,11
86
	
86
 
87
	mcall 30, 1, default_dir
87
	mcall 30, 1, default_dir
Line 88... Line 88...
88
 
88
 
Line 89... Line 89...
89
	; DEBUGF DBG_INFO, "MENU START! sc.work = %x\n", [sc.work]
89
	; DEBUGF DBG_INFO, "MENU START! sc.work = %x\n", [sc.work]
90
 
90
 
91
	mov	esi,bootparam	
91
	mov	esi,bootparam
92
	cmp	[esi],byte 0
92
	cmp	[esi],byte 0
93
	je	.no_boot_parameters
93
	je	.no_boot_parameters
94
; boot params - hex
94
; boot params - hex
Line 103... Line 103...
103
;	call	debug_outstr
103
;	call	debug_outstr
104
;	newline
104
;	newline
Line 105... Line 105...
105
 
105
 
106
	call	conversion_ASCII_to_HEX
106
	call	conversion_ASCII_to_HEX
107
	mov	[menu_button_x.start],ebx
107
	mov	[menu_button_x.start],ebx
108
	
108
 
109
;	dps	"menu_button_x.start: "
109
;	dps	"menu_button_x.start: "
110
;	dpd	ebx
110
;	dpd	ebx
Line 111... Line 111...
111
;	newline
111
;	newline
Line 121... Line 121...
121
	mov	[menu_button_y.start],ebx
121
	mov	[menu_button_y.start],ebx
Line 122... Line 122...
122
 
122
 
123
;	dps	"menu_button_y.start: "
123
;	dps	"menu_button_y.start: "
124
;	dpd	ebx
124
;	dpd	ebx
125
;	newline
125
;	newline
126
	
126
 
127
	call	conversion_ASCII_to_HEX
127
	call	conversion_ASCII_to_HEX
128
	mov	[menu_button_y.size],ebx
128
	mov	[menu_button_y.size],ebx
129
	
129
 
130
;	dps	"menu_button_y.size: "
130
;	dps	"menu_button_y.size: "
131
;	dpd	ebx
131
;	dpd	ebx
132
;	newline
132
;	newline
133
	
133
 
134
	call	conversion_ASCII_to_HEX
134
	call	conversion_ASCII_to_HEX
Line 135... Line 135...
135
	mov	[panel_height],ebx
135
	mov	[panel_height],ebx
136
 
136
 
137
;	dps	"panel_height: "
137
;	dps	"panel_height: "
138
;	dpd	ebx
138
;	dpd	ebx
139
;	newline
139
;	newline
140
	
140
 
141
	call	conversion_ASCII_to_HEX
141
	call	conversion_ASCII_to_HEX
142
	mov	[panel_attachment],ebx
142
	mov	[panel_attachment],ebx
143
	
143
 
144
;	dps	"panel_attachment: "
144
;	dps	"panel_attachment: "
145
;	dpd	ebx
145
;	dpd	ebx
146
;	newline
146
;	newline
147
;--------------------------------------
147
;--------------------------------------
148
align 4	
148
align 4
149
.no_boot_parameters:
149
.no_boot_parameters:
150
	call	program_exist
150
	call	program_exist
151
	mcall	14
151
	mcall	14
152
	mov	[screen_size],eax
152
	mov	[screen_size],eax
Line 153... Line 153...
153
	
153
 
Line 154... Line 154...
154
	mcall	48,3,sc,sizeof.system_colors	; load system colors
154
	mcall	48,3,sc,sizeof.system_colors	; load system colors
Line 233... Line 233...
233
 
233
 
234
	add ecx, 4
234
	add ecx, 4
235
	jmp .for1
235
	jmp .for1
236
.end_for1:
236
.end_for1:
237
.no_res:
237
.no_res:
238
	
238
 
239
; get size of file MENU.DAT
239
; get size of file MENU.DAT
240
	mcall	70,fileinfo
240
	mcall	70,fileinfo
241
	test	eax,eax
241
	test	eax,eax
242
	jnz	close
242
	jnz	close
Line 322... Line 322...
322
	cmp	[panel_attachment],byte 1
322
	cmp	[panel_attachment],byte 1
323
	je	@f
323
	je	@f
324
	xor	ax,ax
324
	xor	ax,ax
325
	jmp	.store
325
	jmp	.store
326
;--------------------------------------
326
;--------------------------------------
327
align 4	
327
align 4
328
@@:
328
@@:
329
	sub	ax,[panel_height]	;20
329
	sub	ax,[panel_height]	;20
330
.store:
330
.store:
331
	mov	ebx,[menu_data]
331
	mov	ebx,[menu_data]
332
	mov	[ebx + y_end],ax
332
	mov	[ebx + y_end],ax
Line 352... Line 352...
352
	add	eax,[menu_data]
352
	add	eax,[menu_data]
353
	mov	edi,eax
353
	mov	edi,eax
354
	mcall	40,100111b	; mouse + button + key + redraw
354
	mcall	40,100111b	; mouse + button + key + redraw
355
;------------------------------------------------------------------------------
355
;------------------------------------------------------------------------------
356
align 4
356
align 4
357
red:	
357
red:
358
	call	draw_window	; redraw
358
	call	draw_window	; redraw
359
;------------------------------------------------------------------------------
359
;------------------------------------------------------------------------------
360
align 4
360
align 4
361
still: ; event loop
361
still: ; event loop
362
	call	free_area_if_set_mutex
362
	call	free_area_if_set_mutex
Line 363... Line 363...
363
 
363
 
364
	mcall	23,5	; wait here for event
364
	mcall	23,5	; wait here for event
365
	test	[close_now],1      ; is close flag set?
365
	test	[close_now],1      ; is close flag set?
366
	jnz	close
366
	jnz	close
367
	
367
 
368
	cmp	eax,1	; redraw request ?
368
	cmp	eax,1	; redraw request ?
369
	je	red
369
	je	red
370
	cmp	eax,2	; key pressed ?
370
	cmp	eax,2	; key pressed ?
371
	je	key
371
	je	key
372
	cmp	eax,3	; button in buffer ?
372
	cmp	eax,3	; button in buffer ?
373
	je	button
373
	je	button
374
	cmp	eax,6	; mouse event ?
374
	cmp	eax,6	; mouse event ?
375
	je	mouse
375
	je	mouse
376
	cmp	edi,[menu_data]
376
	cmp	edi,[menu_data]
377
	je	still	     ; if main process-ignored
377
	je	still	     ; if main process-ignored
378
	
378
 
379
	movzx	ebx,[edi + parent]	 ; parent id
379
	movzx	ebx,[edi + parent]	 ; parent id
380
	shl	ebx,4
380
	shl	ebx,4
381
	add	ebx,[menu_data]      ; ebx = base of parent info
381
	add	ebx,[menu_data]      ; ebx = base of parent info
382
	call	backconvert	     ; get my id in al
382
	call	backconvert	     ; get my id in al
383
	cmp	al,[ebx + child]    ; if I'm not child of my parent, I shall die :)
383
	cmp	al,[ebx + child]    ; if I'm not child of my parent, I shall die :)
384
	jne	close
384
	jne	close
385
	
385
 
386
	jmp	still
386
	jmp	still
387
;------------------------------------------------------------------------------
387
;------------------------------------------------------------------------------
388
align 4
388
align 4
389
key:
389
key:
390
	mcall	2
390
	mcall	2
391
	mov	[last_key],ah
391
	mov	[last_key],ah
392
	mov	al,[edi + rows]     ; number of buttons
392
	mov	al,[edi + rows]     ; number of buttons
393
	cmp	ah,178	  ; KEY_UP
393
	cmp	ah,178	  ; KEY_UP
394
	jne	.noup
394
	jne	.noup
395
	
395
 
396
	mov	ah,[edi+cur_sel]
396
	mov	ah,[edi+cur_sel]
397
	mov	[edi+prev_sel],ah
397
	mov	[edi+prev_sel],ah
398
	dec	byte [edi+cur_sel]
398
	dec	byte [edi+cur_sel]
399
	jnz	redrawbut
399
	jnz	redrawbut
Line 402... Line 402...
402
;--------------------------------------
402
;--------------------------------------
403
align 4
403
align 4
404
.noup:
404
.noup:
405
	cmp	ah,177	 ; KEY_DOWN
405
	cmp	ah,177	 ; KEY_DOWN
406
	jne	.nodn
406
	jne	.nodn
407
	
407
 
408
	mov	ah,[edi + cur_sel]
408
	mov	ah,[edi + cur_sel]
409
	mov	[edi + prev_sel],ah
409
	mov	[edi + prev_sel],ah
410
	inc	[edi + cur_sel]
410
	inc	[edi + cur_sel]
411
	cmp	[edi + cur_sel],al
411
	cmp	[edi + cur_sel],al
412
	jna	redrawbut
412
	jna	redrawbut
Line 454... Line 454...
454
	mov	edi,[edi + pointer]
454
	mov	edi,[edi + pointer]
455
; print "hello"
455
; print "hello"
456
	mov	al,[esi + cur_sel]
456
	mov	al,[esi + cur_sel]
457
	mov	[esi + prev_sel],al
457
	mov	[esi + prev_sel],al
458
	mov	[esi + cur_sel],ah
458
	mov	[esi + cur_sel],ah
459
	
459
 
460
	pushad
460
	pushad
461
	mov	edi,esi
461
	mov	edi,esi
462
; dph eax
462
; dph eax
463
	call	draw_only_needed_buttons
463
	call	draw_only_needed_buttons
464
	popad
464
	popad
Line 470... Line 470...
470
	; DEBUGF DBG_INFO, ".next_string called\n"
470
	; DEBUGF DBG_INFO, ".next_string called\n"
471
	call	searchstartstring
471
	call	searchstartstring
472
	dec	ah
472
	dec	ah
473
	jnz	.next_string
473
	jnz	.next_string
474
	pop	eax
474
	pop	eax
475
	
475
 
476
	mov	ecx,40
476
	mov	ecx,40
477
	mov	al,'|'
477
	mov	al,'|'
478
	cld
478
	cld
479
	repne	scasb
479
	repne	scasb
480
	test	ecx,ecx	  ; if '|' not found
480
	test	ecx,ecx	  ; if '|' not found
481
	je	searchexit
481
	je	searchexit
482
	
482
 
483
	cmp	[edi],byte '@'     ; check for submenu
483
	cmp	[edi],byte '@'     ; check for submenu
484
	je	runthread
484
	je	runthread
485
	
485
 
486
	cmp	[last_key],179
486
	cmp	[last_key],179
487
	je	searchexit
487
	je	searchexit
488
	
488
 
489
	;dec	edi
489
	;dec	edi
490
	push	edi			; pointer to start of filename
490
	push	edi			; pointer to start of filename
491
	call	searchstartstring	; search for next string
491
	call	searchstartstring	; search for next string
492
	sub	edi,2		; to last byte of string
492
	sub	edi,2		; to last byte of string
493
	
493
 
494
	mov	ecx,edi
494
	mov	ecx,edi
495
	pop	esi
495
	pop	esi
496
	sub	ecx,esi
496
	sub	ecx,esi
497
	inc	ecx		 ; length of filename
497
	inc	ecx		 ; length of filename
498
	mov	edi, fileinfo_start.name
498
	mov	edi, fileinfo_start.name
Line 505... Line 505...
505
	; if program run failed then start /sys/@open with param
505
	; if program run failed then start /sys/@open with param
506
	test	eax,eax
506
	test	eax,eax
507
	jns	close
507
	jns	close
508
	mov	eax, fileinfo_start.name
508
	mov	eax, fileinfo_start.name
509
	mov [file_open.params], eax
509
	mov [file_open.params], eax
510
	mcall	70,file_open	
510
	mcall	70,file_open
511
	jmp	close
511
	jmp	close
512
;--------------------------------------
512
;--------------------------------------
513
align 4
513
align 4
514
searchexit:
514
searchexit:
515
	pop	edi
515
	pop	edi
516
	jmp	still
516
	jmp	still
517
;------------------------------------------------------------------------------
517
;------------------------------------------------------------------------------
518
align 4
518
align 4
519
runthread:
519
runthread:
520
	inc	edi
520
	inc	edi
521
	
521
 
522
	push	eax
522
	push	eax
523
	call	get_number	     ; get number of this process
523
	call	get_number	     ; get number of this process
524
	pop	eax
524
	pop	eax
525
	
525
 
526
	test	ebx,ebx	   ; returned zero - main menu or not number
526
	test	ebx,ebx	   ; returned zero - main menu or not number
527
	jz	searchexit
527
	jz	searchexit
528
	
528
 
529
	mov	al,bl
529
	mov	al,bl
530
	
530
 
531
	mov	ebx,[processes]
531
	mov	ebx,[processes]
532
	dec	bl
532
	dec	bl
533
	cmp	al,bl
533
	cmp	al,bl
534
	ja	searchexit	       ; such process doesnt exist
534
	ja	searchexit	       ; such process doesn't exist
535
	cmp	al,[esi + child]
535
	cmp	al,[esi + child]
536
	je	searchexit	       ; such process already exists
536
	je	searchexit	       ; such process already exists
537
	
537
 
538
	mov	[esi + child],al    ; this is my child
538
	mov	[esi + child],al    ; this is my child
539
	mov	cx,[esi + x_start]
539
	mov	cx,[esi + x_start]
540
	add	cx,BTN_WIDTH+1	  ; new x_start in cx
540
	add	cx,BTN_WIDTH+1	  ; new x_start in cx
541
	movzx	edx,al
541
	movzx	edx,al
542
	shl	edx,4
542
	shl	edx,4
Line 544... Line 544...
544
	mov	[edx + x_start],cx  ; xstart for new thread
544
	mov	[edx + x_start],cx  ; xstart for new thread
545
	mov	cx,[esi + y_end]   ; y_end in cx
545
	mov	cx,[esi + y_end]   ; y_end in cx
546
	mov	bl,[esi + rows]    ; number of buttons in bl
546
	mov	bl,[esi + rows]    ; number of buttons in bl
547
	sub	bl,ah	  ; number of btn from bottom
547
	sub	bl,ah	  ; number of btn from bottom
Line 548... Line 548...
548
 
548
 
549
	; Leency: store vars for case when attachement=top 
549
	; Leency: store vars for case when attachement=top
550
	pusha
550
	pusha
551
	mov [prior_thread_selected_y_end], bl
551
	mov [prior_thread_selected_y_end], bl
552
	mcall	9,procinfo,-1
552
	mcall	9,procinfo,-1
553
	m2m     [prior_thread_y], dword[procinfo+38]
553
	m2m     [prior_thread_y], dword[procinfo+38]
Line 569... Line 569...
569
 
569
 
570
	mov	al,[edx + rows]
570
	mov	al,[edx + rows]
571
	mov	[edx + cur_sel],al  ; clear current selected element
571
	mov	[edx + cur_sel],al  ; clear current selected element
572
	mov	[edx + prev_sel],al ; clear previous selected element
572
	mov	[edx + prev_sel],al ; clear previous selected element
573
	mov	[edx + child],0
573
	mov	[edx + child],0
574
	
574
 
575
	mcall	68,12,0x1000	; stack of each thread is allocated 4 KB
575
	mcall	68,12,0x1000	; stack of each thread is allocated 4 KB
576
	add	eax,0x1000	; set the stack pointer to the desired position
576
	add	eax,0x1000	; set the stack pointer to the desired position
577
	mov	edx,eax
577
	mov	edx,eax
578
	mcall	51,1,thread	; Go ahead!
578
	mcall	51,1,thread	; Go ahead!
Line 627... Line 627...
627
;------------------------------------------------------------------------------
627
;------------------------------------------------------------------------------
628
align 4
628
align 4
629
click:
629
click:
630
	cmp	[mousemask],0  ; not in a window (i.e. menu)
630
	cmp	[mousemask],0  ; not in a window (i.e. menu)
631
	jne	still
631
	jne	still
632
; checking for pressing 'MENU' on the taskbar	
632
; checking for pressing 'MENU' on the taskbar
633
	mov	eax,[screen_mouse_position]
633
	mov	eax,[screen_mouse_position]
634
	
634
 
635
	cmp	[panel_attachment],byte 1
635
	cmp	[panel_attachment],byte 1
636
	je	@f
636
	je	@f
Line 637... Line 637...
637
 
637
 
638
	xor	ebx,ebx
638
	xor	ebx,ebx
Line 650... Line 650...
650
	ja	close
650
	ja	close
Line 651... Line 651...
651
 
651
 
652
	add	bx,word [menu_button_y.size]
652
	add	bx,word [menu_button_y.size]
653
	cmp	bx,ax
653
	cmp	bx,ax
654
	jb	close
654
	jb	close
655
	
655
 
656
	shr	eax,16
656
	shr	eax,16
657
	
657
 
658
	mov	ebx,[menu_button_x.start]
658
	mov	ebx,[menu_button_x.start]
659
	cmp	bx,ax	; MENU_BOTTON_X_SIZE
659
	cmp	bx,ax	; MENU_BOTTON_X_SIZE
660
	ja	close
660
	ja	close
661
	
661
 
662
	add	bx,[menu_button_x.size]
662
	add	bx,[menu_button_x.size]
663
	cmp	bx,ax	; MENU_BOTTON_X_POS
663
	cmp	bx,ax	; MENU_BOTTON_X_POS
664
	ja	still
664
	ja	still
665
;------------------------------------------------------------------------------
665
;------------------------------------------------------------------------------
666
align 4
666
align 4
667
close:
667
close:
668
	
668
 
669
	movzx	ebx,[edi+parent]       ; parent id
669
	movzx	ebx,[edi+parent]       ; parent id
670
	shl	ebx,4
670
	shl	ebx,4
671
	add	ebx,[menu_data]          ; ebx = base of parent info
671
	add	ebx,[menu_data]          ; ebx = base of parent info
672
	call	backconvert
672
	call	backconvert
673
	cmp	[ebx + child],al       ; if i am the child of my parent...
673
	cmp	[ebx + child],al       ; if I am the child of my parent...
674
	jnz	@f
674
	jnz	@f
675
	mov	[ebx + child],-1       ; ...my parent now has no children
675
	mov	[ebx + child],-1       ; ...my parent now has no children
676
;--------------------------------------
676
;--------------------------------------
677
align 4
677
align 4
678
@@:
678
@@:
679
	or	eax,-1                 ; close this thread
679
	or	eax,-1                 ; close this thread
680
	mov	[edi + child],al       ; my child is not mine
680
	mov	[edi + child],al       ; my child is not mine
681
	
681
 
682
	call	free_area_if_set_mutex
682
	call	free_area_if_set_mutex
683
	call	set_mutex_for_free_area
683
	call	set_mutex_for_free_area
684
	
684
 
685
	mcall
685
	mcall
686
;--------------------------------------
686
;--------------------------------------
687
align 4
687
align 4
688
backconvert:		  ; convert from pointer to process id
688
backconvert:		  ; convert from pointer to process id
Line 691... Line 691...
691
	shr	eax,4
691
	shr	eax,4
692
	ret
692
	ret
693
;------------------------------------------------------------------------------
693
;------------------------------------------------------------------------------
694
align 4
694
align 4
695
set_mutex_for_free_area:
695
set_mutex_for_free_area:
696
; set mutex for free thread stack area	
696
; set mutex for free thread stack area
697
	push	eax ebx
697
	push	eax ebx
698
;--------------------------------------
698
;--------------------------------------
699
align 4
699
align 4
700
.wait_lock:
700
.wait_lock:
701
        cmp     [free_my_area_lock], 0
701
        cmp     [free_my_area_lock], 0
Line 730... Line 730...
730
	xor	eax,eax
730
	xor	eax,eax
731
	mov	[free_my_area_lock],eax
731
	mov	[free_my_area_lock],eax
732
	pop	ecx ebx eax
732
	pop	ecx ebx eax
733
;--------------------------------------
733
;--------------------------------------
734
align 4
734
align 4
735
.end:	
735
.end:
736
	ret
736
	ret
737
;------------------------------------------------------------------------------
737
;------------------------------------------------------------------------------
738
;==================================
738
;==================================
739
; get_number
739
; get_number
740
;    load number from [edi] to ebx
740
;    load number from [edi] to ebx
Line 822... Line 822...
822
	movzx	ebx,[edi + rows]
822
	movzx	ebx,[edi + rows]
823
	imul	eax,ebx,BTN_HEIGHT	    ; eax = height of window
823
	imul	eax,ebx,BTN_HEIGHT	    ; eax = height of window
824
	movzx	ecx,[edi + y_end]
824
	movzx	ecx,[edi + y_end]
825
	cmp	[panel_attachment],byte 1
825
	cmp	[panel_attachment],byte 1
826
	je	@f
826
	je	@f
827
	
827
 
828
	
828
 
829
	;cmp	ebp,0x000 ; if this is first started thread
829
	;cmp	ebp,0x000 ; if this is first started thread
830
	;je .1            ; then show it at the very top
830
	;je .1            ; then show it at the very top
831
	
831
 
832
	push  ebx eax
832
	push  ebx eax
833
	; if attachement=top 
833
	; if attachement=top
834
	; then NEW_WIN_Y = PRIOR_WIN_Y + PRIOR_WIN_H - ITEM_H + 1 - SEL_ITEM_Y
834
	; then NEW_WIN_Y = PRIOR_WIN_Y + PRIOR_WIN_H - ITEM_H + 1 - SEL_ITEM_Y
Line 835... Line 835...
835
 
835
 
836
	mov ecx, [prior_thread_y]
836
	mov ecx, [prior_thread_y]
837
	add ecx, [prior_thread_h]
837
	add ecx, [prior_thread_h]
Line 840... Line 840...
840
 
840
 
841
	xor eax, eax
841
	xor eax, eax
842
	mov al, [prior_thread_selected_y_end]
842
	mov al, [prior_thread_selected_y_end]
843
	mov ebx, BTN_HEIGHT
843
	mov ebx, BTN_HEIGHT
844
	mul ebx
844
	mul ebx
845
		
845
 
Line 846... Line 846...
846
	sub ecx, eax
846
	sub ecx, eax
847
 
847
 
848
	mov	[edi + cur_sel],1 ;if attachement=top then set item=1 selected
848
	mov	[edi + cur_sel],1 ;if attachement=top then set item=1 selected
Line 849... Line 849...
849
	
849
 
850
	pop eax ebx
850
	pop eax ebx
851
 
851
 
852
	jmp	.1
852
	jmp	.1
853
;--------------------------------------
853
;--------------------------------------
854
align 4
854
align 4
855
@@:	
855
@@:
856
	sub	ecx,eax	    ; ecx = Y_START
856
	sub	ecx,eax	    ; ecx = Y_START
857
;--------------------------------------
857
;--------------------------------------
Line 864... Line 864...
864
	movzx	ebx,[edi + x_start]
864
	movzx	ebx,[edi + x_start]
865
	shl	ebx,16
865
	shl	ebx,16
866
	mov	bx,BTN_WIDTH	    ; ebx = [ X_START | X_SIZE ]
866
	mov	bx,BTN_WIDTH	    ; ebx = [ X_START | X_SIZE ]
867
	mov	edx,0x01000000       ; color of work area RRGGBB,8->color gl
867
	mov	edx,0x01000000       ; color of work area RRGGBB,8->color gl
868
	mov	esi,edx	    ; unmovable window
868
	mov	esi,edx	    ; unmovable window
869
	
869
 
870
	mov	eax,[y_working_area]
870
	mov	eax,[y_working_area]
871
	shr	eax,16
871
	shr	eax,16
872
	ror	ecx,16
872
	ror	ecx,16
873
	test	cx,0x8000
873
	test	cx,0x8000
874
	jz	@f
874
	jz	@f
Line 876... Line 876...
876
;--------------------------------------
876
;--------------------------------------
877
align 4
877
align 4
878
@@:
878
@@:
879
	cmp	cx,ax
879
	cmp	cx,ax
880
	ja	@f
880
	ja	@f
881
	mov	cx,ax	
881
	mov	cx,ax
882
;--------------------------------------
882
;--------------------------------------
883
align 4
883
align 4
884
@@:
884
@@:
885
	rol	ecx,16
885
	rol	ecx,16
886
	xor	eax,eax	    ; function 0 : define and draw window
886
	xor	eax,eax	    ; function 0 : define and draw window
887
	mcall
887
	mcall
888
	
888
 
889
;	dps	"[ Y_START | Y_SIZE ] : "
889
;	dps	"[ Y_START | Y_SIZE ] : "
890
;	dph	ecx
890
;	dph	ecx
891
;	newline
891
;	newline
Line 892... Line 892...
892
 
892
 
Line 949... Line 949...
949
				; dunkaist[
949
				; dunkaist[
950
	add	edx,0xd1ff00	; This makes first menu buttons differ
950
	add	edx,0xd1ff00	; This makes first menu buttons differ
951
				; from system close button with 0x000001 id
951
				; from system close button with 0x000001 id
952
				; dunkaist]
952
				; dunkaist]
953
	mcall
953
	mcall
954
	push edx 
954
	push edx
955
	
955
 
956
	mov edx, esi
956
	mov edx, esi
957
	mcall 13 ; draw rect
957
	mcall 13 ; draw rect
958
	
958
 
959
	mcall , BTN_WIDTH,<[draw_y],1>,[sc.work_light]
959
	mcall , BTN_WIDTH,<[draw_y],1>,[sc.work_light]
960
	add     ecx, BTN_HEIGHT-1
960
	add     ecx, BTN_HEIGHT-1
961
	mcall , 1
961
	mcall , 1
962
	inc     ecx
962
	inc     ecx
963
	mcall , , , [sc.work_dark]
963
	mcall , , , [sc.work_dark]
964
	add     [draw_y], BTN_HEIGHT-1
964
	add     [draw_y], BTN_HEIGHT-1
965
	mcall , BTN_WIDTH,<[draw_y],1>
965
	mcall , BTN_WIDTH,<[draw_y],1>
966
	
966
 
967
	pop edx
967
	pop edx
968
	movzx	edx,dl
968
	movzx	edx,dl
969
	dec	dl
969
	dec	dl
970
	imul	ebx,edx,BTN_HEIGHT
970
	imul	ebx,edx,BTN_HEIGHT
971
	add	ebx,((4 + 18) shl 16) + TXT_Y ; added + 18 (icon size)
971
	add	ebx,((4 + 18) shl 16) + TXT_Y ; added + 18 (icon size)
Line 985... Line 985...
985
	inc	edx ; go to next char after \r
985
	inc	edx ; go to next char after \r
986
	cmp	byte [edx],10 ; if it is not \n then again findline
986
	cmp	byte [edx],10 ; if it is not \n then again findline
987
	jne	.findline
987
	jne	.findline
988
	dec	ecx ; TODO what in ecx? button number?
988
	dec	ecx ; TODO what in ecx? button number?
989
	jnz	.findline
989
	jnz	.findline
990
	
990
 
991
	mov ecx, [sc.work_text]
991
	mov ecx, [sc.work_text]
992
	add ecx, FONT_TYPE
992
	add ecx, FONT_TYPE
Line 993... Line 993...
993
 
993
 
994
	push ecx esi edi ebp
994
	push ecx esi edi ebp
Line 1042... Line 1042...
1042
	mov ecx, [shared_icons_ptr]
1042
	mov ecx, [shared_icons_ptr]
1043
	; DEBUGF DBG_INFO, "is_icon_active = %x\n", [is_icon_active]
1043
	; DEBUGF DBG_INFO, "is_icon_active = %x\n", [is_icon_active]
1044
 	cmp [is_icon_active], 1
1044
 	cmp [is_icon_active], 1
1045
 	jne .not_active_icon
1045
 	jne .not_active_icon
1046
 	mov ecx, [shared_icons_active_ptr]
1046
 	mov ecx, [shared_icons_active_ptr]
1047
.not_active_icon:	
1047
.not_active_icon:
1048
	add ebx, ecx
1048
	add ebx, ecx
1049
	mcall 65, ebx, <18,18>, [tmp], 32, 0, 0
1049
	mcall 65, ebx, <18,18>, [tmp], 32, 0, 0
Line 1050... Line 1050...
1050
 
1050
 
1051
@@:
1051
@@:
1052
	pop ebp edi esi ecx
1052
	pop ebp edi esi ecx
1053
	
1053
 
1054
	pop	edx
1054
	pop	edx
1055
	ret
1055
	ret
1056
;------------------------------------------------------------------------------
1056
;------------------------------------------------------------------------------
1057
align 4
1057
align 4