Subversion Repositories Kolibri OS

Rev

Rev 2550 | Rev 3671 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2550 Rev 2639
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                               ;;
2
;;                               ;;
3
;;          DEVICE SETUP         ;;
3
;;          DEVICE SETUP         ;;
4
;;                               ;;
4
;;                               ;;
5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
 
6
; version:	1.15
-
 
7
; last update:  20/04/2012
-
 
8
; changed by:   Marat Zakiyanov aka Mario79, aka Mario
-
 
9
; changes:      Add the flag of speaker mute.
-
 
10
;               Correcting setup.dat
-
 
11
;---------------------------------------------------------------------
6
; version:	1.14
12
; version:	1.14
7
; last update:  20/03/2012
13
; last update:  20/03/2012
8
; changed by:   Marat Zakiyanov aka Mario79, aka Mario
14
; changed by:   Marat Zakiyanov aka Mario79, aka Mario
9
; changes:      optimisations and code refactoring
15
; changes:      optimisations and code refactoring
10
;---------------------------------------------------------------------
16
;---------------------------------------------------------------------
Line 19... Line 25...
19
 
25
 
20
	db 'MENUET01'	; 8 byte identifier
26
	db 'MENUET01'	; 8 byte identifier
21
	dd 0x01		; header version
27
	dd 0x01		; header version
22
	dd START	; pointer to program start
28
	dd START	; pointer to program start
23
	dd IM_END	; size of image
29
	dd IM_END	; size of image
24
	dd I_END	;0x4000	; reguired amount of memory
30
	dd I_END	; reguired amount of memory
25
	dd stack_area	; stack pointer (esp)
31
	dd stack_area	; stack pointer (esp)
26
	dd I_PARAM	; boot parameters
32
	dd boot_param	; boot parameters
27
	dd 0x0		; path
33
	dd 0x0		; path
28
;-------------------------------------------------------------------------------
34
;-------------------------------------------------------------------------------
29
include '..\..\..\macros.inc'
35
include '..\..\..\macros.inc'
30
;-------------------------------------------------------------------------------
36
;-------------------------------------------------------------------------------
Line 35... Line 41...
35
	call	_pci_acc    ;12
41
	call	_pci_acc    ;12
36
	call	_syslang    ;5
42
	call	_syslang    ;5
37
	call	_keyboard    ;2
43
	call	_keyboard    ;2
38
	call	_mouse_speed
44
	call	_mouse_speed
39
	call	_mouse_delay
45
	call	_mouse_delay
-
 
46
	call	_speaker_mute
40
	ret
47
	ret
41
;-------------------------------------------------------------------------------
48
;-------------------------------------------------------------------------------
42
apply_all_and_exit:
49
apply_all_and_exit:
43
	mcall	70,read_fileinfo
50
	mcall	70,read_fileinfo
44
	call	apply_all
51
	call	apply_all
Line 89... Line 96...
89
	mcall	18,19,0
96
	mcall	18,19,0
90
	mov	[mouse_speed],eax
97
	mov	[mouse_speed],eax
Line 91... Line 98...
91
 
98
 
92
	mcall	18,19,2
99
	mcall	18,19,2
-
 
100
	mov	[mouse_delay],eax
-
 
101
	
-
 
102
	mcall	18,8,1
93
	mov	[mouse_delay],eax
103
	mov	[speaker_mute],eax
94
	ret
104
	ret
95
;-------------------------------------------------------------------------------
105
;-------------------------------------------------------------------------------
96
START:
106
START:
97
	mov	eax,I_PARAM
107
	mov	eax,boot_param
98
	cmp	[eax],dword 'SLAN'
108
	cmp	[eax],dword 'SLAN'
Line 99... Line 109...
99
	je	set_syslanguage_and_exit
109
	je	set_syslanguage_and_exit
100
 
110
 
Line 104... Line 114...
104
	cmp	[eax],dword 'BOOT'
114
	cmp	[eax],dword 'BOOT'
105
	je	apply_all_and_exit
115
	je	apply_all_and_exit
Line 106... Line 116...
106
 
116
 
107
	call	get_setup_values
117
	call	get_setup_values
-
 
118
	call	loadtxt
108
	call	loadtxt
119
	call	draw_infotext
109
;-------------------------------------------------------------------------------
120
;-------------------------------------------------------------------------------
110
red:
121
red:
111
	call	draw_window
122
	call	draw_window
112
;-------------------------------------------------------------------------------
123
;-------------------------------------------------------------------------------
Line 308... Line 319...
308
	mov	[mouse_delay],eax
319
	mov	[mouse_delay],eax
309
	call	draw_infotext
320
	call	draw_infotext
310
;--------------------------------------
321
;--------------------------------------
311
.noplus:
322
.noplus:
312
	cmp	ah,141
323
	cmp	ah,141
313
	jnz	.noapply
324
	jnz	speakermute
314
	call	_mouse_delay
325
	call	_mouse_delay
315
;--------------------------------------
326
;--------------------------------------
-
 
327
speakermute:
-
 
328
	cmp	ah,152	; SET SPEAKER
-
 
329
	jne	no_speaker_d
-
 
330
;--------------------------------------
-
 
331
speaker_p:
-
 
332
	btc	[speaker_mute],0
-
 
333
	call	draw_infotext
-
 
334
	jmp	still
-
 
335
;--------------------------------------
-
 
336
no_speaker_d:
-
 
337
	cmp	ah,153
-
 
338
	jne	no_speaker_i
-
 
339
	jmp	speaker_p
-
 
340
;--------------------------------------
-
 
341
no_speaker_i:
-
 
342
	cmp	ah,151
-
 
343
	jne	.noapply
-
 
344
	call	_speaker_mute
-
 
345
	jmp	still
-
 
346
;--------------------------------------
316
.noapply:
347
.noapply:
317
	cmp	ah,3	      ; SET KEYMAP
348
	cmp	ah,3	      ; SET KEYMAP
318
	jne	still
349
	jne	still
319
	call	_keyboard
350
	call	_keyboard
320
	jmp	still
351
	jmp	still
Line 422... Line 453...
422
	pusha
453
	pusha
423
	mcall	12,1
454
	mcall	12,1
Line 424... Line 455...
424
 
455
 
425
	xor	eax,eax       ; DRAW WINDOW
456
	xor	eax,eax       ; DRAW WINDOW
426
	xor	esi,esi
457
	xor	esi,esi
Line 427... Line 458...
427
	mcall	,<40,(355+BBB)>,<40,(12*15)>,0xB4111199,,title
458
	mcall	,<40,(355+BBB)>,<40,(12*16)>,0xB4111199,,title
Line 428... Line 459...
428
	
459
	
429
	mcall	9,procinfo,-1
460
	mcall	9,procinfo,-1
430
	
461
	
Line 431... Line 462...
431
	mov	eax,[ebx+70] ;status of window
462
	mov	eax,[ebx+70] ;status of window
Line 432... Line 463...
432
	test	eax,100b
463
	test	eax,100b
433
	jne	.end
464
	jne	.end
434
 
465
 
Line 462... Line 493...
462
 
493
 
463
	mov	edx,141
494
	mov	edx,141
464
	mov	ecx,5+10*8
495
	mov	ecx,5+10*8
Line -... Line 496...
-
 
496
	call	draw_buttons
-
 
497
	
-
 
498
	mov	edx,151
-
 
499
	mov	ecx,5+12*8
465
	call	draw_buttons
500
	call	draw_buttons
466
 
501
 
467
	call	draw_infotext
502
	call	draw_infotext
468
.end:
503
.end:
469
	mcall	12,2
504
	mcall	12,2
Line 553... Line 588...
553
 
588
 
554
	mov	eax,[pci_acc]
589
	mov	eax,[pci_acc]
555
	call	onoff				; PCI ACCESS
590
	call	onoff				; PCI ACCESS
Line -... Line 591...
-
 
591
	mov	[text00+LLL*3+28],ebx
-
 
592
	
-
 
593
	mov	eax,[speaker_mute]
-
 
594
	call	onoff				; SPEAKER
556
	mov	[text00+LLL*3+28],ebx
595
	mov	[text00+LLL*6+28],ebx
557
 
596
 
558
	mov	eax,[mouse_speed]		; MOUSE SPEED
597
	mov	eax,[mouse_speed]		; MOUSE SPEED
Line 559... Line 598...
559
	add	al,48
598
	add	al,48
560
	mov	[text00+LLL*4+28],al
599
	mov	[text00+LLL*4+28],al
561
 
600
 
562
	mov	eax,[mouse_delay]
601
	mov	eax,[mouse_delay]
-
 
602
	mov	esi,text00+LLL*5+32
563
	mov	esi,text00+LLL*5+32
603
	call	hexconvert			; MOUSE DELAY
564
	call	hexconvert			; MOUSE DELAY
604
	call	text_out
565
	call	text_out
605
	
566
	popa
606
	popa
567
	ret
607
	ret
Line 568... Line 608...
568
;-------------------------------------------------------------------------------
608
;-------------------------------------------------------------------------------
569
text_out:
609
text_out:
570
	mcall	13,<165,85>,<0,(12*8)>,0x80111199	;0x80111199-19
610
	mcall	13,<165,85>,<0,(14*8)>,0x80111199	;0x80111199-19
571
 
611
 
Line 655... Line 695...
655
;-------------------------------------------------------------------------------
695
;-------------------------------------------------------------------------------
656
_mouse_delay:
696
_mouse_delay:
657
	mcall	18,19,3,[mouse_delay]
697
	mcall	18,19,3,[mouse_delay]
658
	ret
698
	ret
659
;-------------------------------------------------------------------------------
699
;-------------------------------------------------------------------------------
-
 
700
_speaker_mute:
-
 
701
	mcall	18,8,1
-
 
702
	cmp	[speaker_mute],eax
-
 
703
	je	@f
-
 
704
	inc	ecx
-
 
705
	mcall	18
-
 
706
;--------------------------------------	
-
 
707
@@:
-
 
708
	ret
-
 
709
;-------------------------------------------------------------------------------
660
loadtxt:
710
loadtxt:
661
	mov	edi,text00
711
	mov	edi,text00
662
	mov	ecx,LLL*(text1_strings + text2_strings)/4
712
	mov	ecx,LLL*(text1_strings + text2_strings)/4+1
663
	cmp	[syslang],4
713
	cmp	[syslang],4
664
	jne	norus
714
	jne	norus
Line 665... Line 715...
665
 
715
 
666
	mov	esi,textrus
716
	mov	esi,textrus
Line 693... Line 743...
693
	db ' áª« ¤ª  ª« ¢¨ âãàë      : ENGLISH         - +   à¨¬¥­¨âì'
743
	db ' áª« ¤ª  ª« ¢¨ âãàë      : ENGLISH         - +   à¨¬¥­¨âì'
694
	db '‚ª«îç¨âì LBA              : OFF             - +   à¨¬¥­¨âì'
744
	db '‚ª«îç¨âì LBA              : OFF             - +   à¨¬¥­¨âì'
695
	db '„®áâ㯠ª 設¥ PCI         : OFF             - +   à¨¬¥­¨âì'
745
	db '„®áâ㯠ª 設¥ PCI         : OFF             - +   à¨¬¥­¨âì'
696
	db '‘ª®à®áâì ªãàá®à  ¬ëè¨     : 1               - +   à¨¬¥­¨âì'
746
	db '‘ª®à®áâì ªãàá®à  ¬ëè¨     : 1               - +   à¨¬¥­¨âì'
697
	db '‡ ¤¥à¦ª  ã᪮७¨ï ¬ëè¨   : 0x00a           - +   à¨¬¥­¨âì'
747
	db '‡ ¤¥à¦ª  ã᪮७¨ï ¬ëè¨   : 0x00a           - +   à¨¬¥­¨âì'
-
 
748
	db '‚몫îç¨âì SPEAKER         : OFF             - +   à¨¬¥­¨âì'
Line 698... Line 749...
698
	
749
	
699
	db '‚ˆŒ€ˆ…:                                    à¨¬¥­¨âì ¢á¥ '
750
	db '‚ˆŒ€ˆ…:                                    à¨¬¥­¨âì ¢á¥ '
700
	db '… ‡€“„œ’… ‘Ž•€ˆ’œ €‘’Ž‰Šˆ              ‘®åà ­¨âì ¢á¥ '
751
	db '… ‡€“„œ’… ‘Ž•€ˆ’œ €‘’Ž‰Šˆ              ‘®åà ­¨âì ¢á¥ '
701
;-------------------------------------------------------------------------------
752
;-------------------------------------------------------------------------------
702
texteng:
753
texteng:
703
	db 'SYSTEM LANGUAGE           : ENGLISH         - +     APPLY  '
754
	db 'System language           : ENGLISH         - +     Apply  '
704
	db 'KEYBOARD LAYOUT           : ENGLISH         - +     APPLY  '
755
	db 'Keyboard layout           : ENGLISH         - +     Apply  '
705
	db 'LBA READ ENABLED          : OFF             - +     APPLY  '
756
	db 'LBA read enabled          : OFF             - +     Apply  '
706
	db 'PCI ACCESS FOR APPL.      : OFF             - +     APPLY  '
757
	db 'PCI access for appl.      : OFF             - +     Apply  '
707
	db 'Mouse pointer speed       : 1               - +     APPLY  '
758
	db 'Mouse pointer speed       : 1               - +     Apply  '
-
 
759
	db 'Mouse pointer delay       : 0x00a           - +     Apply  '
708
	db 'Mouse pointer delay       : 0x00a           - +     APPLY  '
760
	db 'SPEAKER disabled          : OFF             - +     Apply  '
Line 709... Line 761...
709
text1_strings = 6
761
text1_strings = 7
710
 
762
 
711
	db 'NOTE:                                           APPLY ALL  '
763
	db 'NOTE:                                           Apply all  '
712
	db 'SAVE YOUR SETTINGS BEFORE QUITING KOLIBRI       SAVE ALL   '
764
	db 'SAVE YOUR SETTINGS BEFORE QUITING KOLIBRI       Save all   '
713
text2_strings = 2
765
text2_strings = 2
Line 714... Line 766...
714
;-------------------------------------------------------------------------------
766
;-------------------------------------------------------------------------------
Line 720... Line 772...
720
;-------------------------------------------------------------------------------
772
;-------------------------------------------------------------------------------
721
read_fileinfo:
773
read_fileinfo:
722
	dd 0
774
	dd 0
723
	dd 0
775
	dd 0
724
	dd 0
776
	dd 0
725
	dd 48
777
	dd 28
726
	dd keyboard
778
	dd keyboard
727
	db 0
779
	db 0
728
	dd file_name
780
	dd file_name
729
;-------------------------------------------------------------------------------
781
;-------------------------------------------------------------------------------
730
save_fileinfo:
782
save_fileinfo:
731
	dd 2
783
	dd 2
732
	dd 0
784
	dd 0
733
	dd 0
785
	dd 0
734
	dd 48
786
	dd 28
735
	dd keyboard
787
	dd keyboard
736
file_name:	db '/sys/setup.dat',0
788
file_name:	db '/sys/setup.dat',0
737
;-------------------------------------------------------------------------------
789
;-------------------------------------------------------------------------------
738
; Note to SVN revision 2299 - some parameters has not used,
-
 
739
; but keep the order of the parameter has always needed!
-
 
740
keyboard	dd 0x0
790
keyboard	dd 0x0
741
		dd 0	;midibase  - not use, but retained for backward compat.
-
 
742
		dd 0	;cdbase - not use, but retained for backward compat.
-
 
743
		dd 0	;sb16 - not use, but retained for backward compat.
-
 
744
syslang		dd 0x1
791
syslang		dd 0x4	; 4 - rus
745
		dd 0	;hdbase - not use, but retained for backward compat.
-
 
746
		dd 0	;f32p - not use, but retained for backward compat.
-
 
747
		dd 0	;sound_dma - not use, but retained for backward compat.
-
 
748
lba_read	dd 0x1
792
lba_read	dd 0x1
749
pci_acc		dd 0x1
793
pci_acc		dd 0x1
750
mouse_speed	dd 0x3
794
mouse_speed	dd 0x2
751
mouse_delay	dd 0x10
795
mouse_delay	dd 0xa
-
 
796
speaker_mute	dd 0	; 0 - enable, 1 - disable
752
;-----------------------------------------------------------------------------
797
;-----------------------------------------------------------------------------
753
IM_END:
798
IM_END:
754
;-----------------------------------------------------------------------------
799
;-----------------------------------------------------------------------------
755
align 4
800
align 4
756
text00:
801
text00:
757
	rb LLL*(text1_strings + text2_strings)
802
	rb LLL*(text1_strings + text2_strings)+4
758
;-----------------------------------------------------------------------------
803
;-----------------------------------------------------------------------------
759
align 4
804
align 4
760
I_PARAM:
805
boot_param:
761
procinfo:
806
procinfo:
762
	rb 1024
807
	rb 1024
763
;-----------------------------------------------------------------------------
808
;-----------------------------------------------------------------------------
764
align 4
809
align 4
765
	rb 0x1000
810
	rb 0x1000