Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 485
Line 3... Line 3...
3
;
3
;
4
;    Compile with FASM for Menuet
4
;    Compile with FASM for Menuet
5
;
5
;
Line 6... Line 6...
6
 
6
 
7
include 'lang.inc'
7
include 'lang.inc'
Line 8... Line 8...
8
include 'macros.inc'
8
include '..\..\..\macros.inc'
Line 9... Line 9...
9
 
9
 
Line 41... Line 41...
41
 
41
 
Line 42... Line 42...
42
    call draw_window            ; at first, draw the window
42
    call draw_window            ; at first, draw the window
43
 
43
 
44
    mov  eax,26
44
    mov  eax,26
45
    mov  ebx,9
45
    mov  ebx,9
Line 46... Line 46...
46
    int  0x40
46
    mcall
Line 47... Line 47...
47
    mov  [next_tic],eax
47
    mov  [next_tic],eax
Line 56... Line 56...
56
 
56
 
57
    mov  eax,55
57
    mov  eax,55
58
    mov  ebx,2
58
    mov  ebx,2
59
    mov  ecx,0
59
    mov  ecx,0
60
    mov  edx,[mono_stereo]
60
    mov  edx,[mono_stereo]
Line 61... Line 61...
61
    int  0x40
61
    mcall
62
 
62
 
63
    mov  eax,23                 ; wait here for event
63
    mov  eax,23                 ; wait here for event
Line 64... Line 64...
64
    mov  ebx,1
64
    mov  ebx,1
65
    int  0x40
65
    mcall
Line 66... Line 66...
66
 
66
 
Line 72... Line 72...
72
    cmp  [onoff],0
72
    cmp  [onoff],0
73
    je   still
73
    je   still
Line 74... Line 74...
74
 
74
 
75
    mov  eax,26
75
    mov  eax,26
76
    mov  ebx,9
76
    mov  ebx,9
77
    int  0x40
77
    mcall
78
    mov  ebx,[next_tic]
78
    mov  ebx,[next_tic]
79
    cmp  eax,ebx
79
    cmp  eax,ebx
Line 80... Line 80...
80
    jge  play_wave_block
80
    jge  play_wave_block
Line 99... Line 99...
99
 
99
 
100
    cmp  eax,16+4
100
    cmp  eax,16+4
101
    jne  no_irman
101
    jne  no_irman
102
    mov  eax,42
102
    mov  eax,42
103
    mov  ebx,4
103
    mov  ebx,4
104
    int  0x40
104
    mcall
105
    dec  [ir_count]
105
    dec  [ir_count]
106
    cmp  bl,140
106
    cmp  bl,140
107
    jne  no_first
107
    jne  no_first
108
    mov  [ir_count],3
108
    mov  [ir_count],3
Line 134... Line 134...
134
  play_wave_block:
134
  play_wave_block:
Line 135... Line 135...
135
 
135
 
136
    mov  eax,55    ; load wave
136
    mov  eax,55    ; load wave
137
    mov  ebx,0
137
    mov  ebx,0
138
    mov  ecx,[playposition]
138
    mov  ecx,[playposition]
Line 139... Line 139...
139
    int  0x40
139
    mcall
140
 
140
 
141
    mov  eax,55    ; play wave
141
    mov  eax,55    ; play wave
Line 142... Line 142...
142
    mov  ebx,1
142
    mov  ebx,1
143
    int  0x40
143
    mcall
144
 
144
 
145
    mov  eax,26
145
    mov  eax,26
146
    mov  ebx,9
146
    mov  ebx,9
Line 147... Line 147...
147
    int  0x40
147
    mcall
148
    add  eax,[delay]
148
    add  eax,[delay]
Line 157... Line 157...
157
    call draw_window
157
    call draw_window
158
    jmp  still
158
    jmp  still
Line 159... Line 159...
159
 
159
 
160
  key:                          ; key
160
  key:                          ; key
161
    mov  eax,2                  ; just read it and ignore
161
    mov  eax,2                  ; just read it and ignore
162
    int  0x40
162
    mcall
Line 163... Line 163...
163
    jmp  still2
163
    jmp  still2
164
 
164
 
165
  button:                       ; button
165
  button:                       ; button
Line 166... Line 166...
166
    mov  eax,17                 ; get id
166
    mov  eax,17                 ; get id
167
    int  0x40
167
    mcall
168
 
168
 
169
    cmp  ah,6
169
    cmp  ah,6
Line 231... Line 231...
231
    cmp  [infrared_enabled],1
231
    cmp  [infrared_enabled],1
232
    jne  no_dis
232
    jne  no_dis
233
    mov  eax,45
233
    mov  eax,45
234
    mov  ebx,1
234
    mov  ebx,1
235
    mov  ecx,4
235
    mov  ecx,4
236
    int  0x40
236
    mcall
237
    mov  eax,46
237
    mov  eax,46
238
    mov  ebx,1
238
    mov  ebx,1
239
    mov  ecx,0x3f0
239
    mov  ecx,0x3f0
240
    mov  edx,0x3ff
240
    mov  edx,0x3ff
241
    int  0x40
241
    mcall
242
  no_dis:
242
  no_dis:
243
    mov  eax,-1                 ; close this program
243
    mov  eax,-1                 ; close this program
244
    int  0x40
244
    mcall
245
  noclose:
245
  noclose:
Line 246... Line 246...
246
 
246
 
Line 252... Line 252...
252
    pusha
252
    pusha
Line 253... Line 253...
253
 
253
 
254
    mov  eax,55
254
    mov  eax,55
255
    mov  ebx,0
255
    mov  ebx,0
256
    mov  ecx,0x20000
256
    mov  ecx,0x20000
Line 257... Line 257...
257
    int  0x40
257
    mcall
258
 
258
 
Line 259... Line 259...
259
    popa
259
    popa
Line 298... Line 298...
298
    shr   edx,1
298
    shr   edx,1
299
    mov  esi,128
299
    mov  esi,128
300
    sub  esi,edx
300
    sub  esi,edx
301
    add  ecx,esi
301
    add  ecx,esi
302
    mov  edx,0x00ff00
302
    mov  edx,0x00ff00
303
    int  0x40
303
    mcall
Line 304... Line 304...
304
 
304
 
305
    mov  eax,13
305
    mov  eax,13
306
    mov  ebx,320*65536+20
306
    mov  ebx,320*65536+20
307
    movzx edx,byte [edi]
307
    movzx edx,byte [edi]
308
    shr  edx,1
308
    shr  edx,1
309
    mov  ecx,edx
309
    mov  ecx,edx
310
    add  ecx,(50+128)*65536+1
310
    add  ecx,(50+128)*65536+1
311
    shl  edx,16
311
    shl  edx,16
312
    sub  ecx,edx
312
    sub  ecx,edx
313
    mov  edx,0xff0000
313
    mov  edx,0xff0000
Line 314... Line 314...
314
    int  0x40
314
    mcall
Line 315... Line 315...
315
 
315
 
Line 327... Line 327...
327
    mov  dword [file_info+12],0x10000+1024   ; return data pointer
327
    mov  dword [file_info+12],0x10000+1024   ; return data pointer
328
    mov  dword [file_info+16],0x60000        ; work area for os
328
    mov  dword [file_info+16],0x60000        ; work area for os
Line 329... Line 329...
329
 
329
 
330
    mov  eax,58
330
    mov  eax,58
331
    mov  ebx,file_info
331
    mov  ebx,file_info
Line 332... Line 332...
332
    int  0x40
332
    mcall
333
 
333
 
334
    movzx eax,byte [0x10000+1024+12+10]
334
    movzx eax,byte [0x10000+1024+12+10]
335
    mov   [channels],eax
335
    mov   [channels],eax
Line 379... Line 379...
379
 
379
 
380
    mov  eax,13
380
    mov  eax,13
381
    mov  ebx,190*65536+10
381
    mov  ebx,190*65536+10
382
    mov  ecx,104*65536+10
382
    mov  ecx,104*65536+10
383
    mov  edx,0xff0000
383
    mov  edx,0xff0000
384
    int  0x40
384
    mcall
Line 385... Line 385...
385
    pusha
385
    pusha
386
 
386
 
387
    mov  eax,5
387
    mov  eax,5
Line 388... Line 388...
388
    mov  ebx,[pause_between_songs]
388
    mov  ebx,[pause_between_songs]
389
    int  0x40
389
    mcall
390
 
390
 
391
    popa
391
    popa
Line 392... Line 392...
392
    mov  eax,13
392
    mov  eax,13
Line 393... Line 393...
393
    mov  edx,0x000000
393
    mov  edx,0x000000
Line 428... Line 428...
428
    mov  dword [file_info+12],0x10000+1024   ; return data pointer
428
    mov  dword [file_info+12],0x10000+1024   ; return data pointer
429
    mov  dword [file_info+16],0x60000        ; work area for os
429
    mov  dword [file_info+16],0x60000        ; work area for os
Line 430... Line 430...
430
 
430
 
431
    mov  eax,58
431
    mov  eax,58
432
    mov  ebx,file_info
432
    mov  ebx,file_info
Line 433... Line 433...
433
    int  0x40
433
    mcall
434
 
434
 
435
 
435
 
436
    pusha
436
    pusha
437
    mov  eax,11
437
    mov  eax,11
438
    int  0x40
438
    mcall
439
    cmp  eax,1
439
    cmp  eax,1
440
    jne  no_wd
440
    jne  no_wd
Line 446... Line 446...
446
    mov  eax,38
446
    mov  eax,38
447
    mov  ebx,1*65536+128
447
    mov  ebx,1*65536+128
448
    mov  ecx,71*65536+71
448
    mov  ecx,71*65536+71
449
    add  ebx,25*65536+25
449
    add  ebx,25*65536+25
450
    mov  edx,0x555555
450
    mov  edx,0x555555
451
;    int  0x40
451
;    mcall
452
    mov  eax,38
452
    mov  eax,38
453
    mov  ebx,[esp+32-12]
453
    mov  ebx,[esp+32-12]
454
    and  ebx,65536/512 -1
454
    and  ebx,65536/512 -1
455
    or   ebx,1*65536
455
    or   ebx,1*65536
456
    add  ebx,25*65536+25
456
    add  ebx,25*65536+25
457
    mov  ecx,71*65536+71
457
    mov  ecx,71*65536+71
458
    mov  edx,0x999999
458
    mov  edx,0x999999
459
;    int  0x40
459
;    mcall
460
    popa
460
    popa
Line 461... Line 461...
461
 
461
 
462
    cmp  eax,0
462
    cmp  eax,0
Line 474... Line 474...
474
    mov  [block],20
474
    mov  [block],20
Line 475... Line 475...
475
 
475
 
476
    mov  eax,5
476
    mov  eax,5
477
    mov  ebx,[pause_between_songs]
477
    mov  ebx,[pause_between_songs]
478
    add  ebx,[delay]
478
    add  ebx,[delay]
Line 479... Line 479...
479
    int  0x40
479
    mcall
Line 480... Line 480...
480
 
480
 
481
    call read_header
481
    call read_header
Line 630... Line 630...
630
 
630
 
Line 631... Line 631...
631
    mov  edi,[addr]
631
    mov  edi,[addr]
632
 
632
 
633
  f11:
633
  f11:
634
    mov  eax,10
634
    mov  eax,10
635
    int  0x40
635
    mcall
636
    cmp  eax,2
636
    cmp  eax,2
637
    jne  read_done
637
    jne  read_done
638
    mov  eax,2
638
    mov  eax,2
639
    int  0x40
639
    mcall
640
    shr  eax,8
640
    shr  eax,8
641
    cmp  eax,13
641
    cmp  eax,13
642
    je   read_done
642
    je   read_done
Line 687... Line 687...
687
 
687
 
688
    mov  eax,13                ; gray progress bar
688
    mov  eax,13                ; gray progress bar
689
    mov  ebx,25*65536+215
689
    mov  ebx,25*65536+215
690
    mov  ecx,61*65536+8
690
    mov  ecx,61*65536+8
691
    mov  edx,[border]
691
    mov  edx,[border]
Line 692... Line 692...
692
    int  0x40
692
    mcall
693
 
693
 
694
    cmp  [onoff],1
694
    cmp  [onoff],1
695
    je   yes_playing
695
    je   yes_playing
Line 708... Line 708...
708
    mov  eax,13
708
    mov  eax,13
709
    add  ebx,25*65536
709
    add  ebx,25*65536
710
    mov  ecx,61*65536+1
710
    mov  ecx,61*65536+1
711
    mov  edx,[drawp]
711
    mov  edx,[drawp]
712
   newbar:
712
   newbar:
713
    int  0x40
713
    mcall
714
    add  edx,0x101010
714
    add  edx,0x101010
715
    add  ecx,1*65536
715
    add  ecx,1*65536
716
    cmp  ecx,65*65536
716
    cmp  ecx,65*65536
717
    jb   newbar
717
    jb   newbar
718
   newbar2:
718
   newbar2:
719
    int  0x40
719
    mcall
720
    sub  edx,0x101010
720
    sub  edx,0x101010
721
    add  ecx,1*65536
721
    add  ecx,1*65536
722
    cmp  ecx,69*65536
722
    cmp  ecx,69*65536
723
    jb   newbar2
723
    jb   newbar2
Line 736... Line 736...
736
    mov   ecx,61*65536+9
736
    mov   ecx,61*65536+9
737
    mov   edx,0xeeeeff
737
    mov   edx,0xeeeeff
738
    mov   eax,13
738
    mov   eax,13
739
    mov   edi,5
739
    mov   edi,5
740
  newb:
740
  newb:
741
;    int   0x40
741
;    mcall
742
    add   ebx,1*65536-2
742
    add   ebx,1*65536-2
743
    add   ecx,1*65536-2
743
    add   ecx,1*65536-2
744
    sub   edx,0x332211;3366aa
744
    sub   edx,0x332211;3366aa
745
    dec   edi
745
    dec   edi
746
    jnz   newb
746
    jnz   newb
Line 756... Line 756...
756
 
756
 
757
    mov  eax,13
757
    mov  eax,13
758
    mov  ebx,42*65536+33*6
758
    mov  ebx,42*65536+33*6
759
    mov  ecx,114*65536+11
759
    mov  ecx,114*65536+11
760
    mov  edx,0x000000
760
    mov  edx,0x000000
Line 761... Line 761...
761
    int  0x40
761
    mcall
762
 
762
 
763
    mov  eax,4
763
    mov  eax,4
764
    mov  ebx,42*65536+117
764
    mov  ebx,42*65536+117
765
    mov  ecx,[textc]
765
    mov  ecx,[textc]
766
    mov  edx,now_playing
766
    mov  edx,now_playing
Line 767... Line 767...
767
    mov  esi,38
767
    mov  esi,38
Line 768... Line 768...
768
    int  0x40
768
    mcall
Line 779... Line 779...
779
    pusha
779
    pusha
Line 780... Line 780...
780
 
780
 
781
    mov  eax,50
781
    mov  eax,50
782
    mov  ebx,0
782
    mov  ebx,0
783
    mov  ecx,shape_reference
783
    mov  ecx,shape_reference
Line 784... Line 784...
784
    int  0x40
784
    mcall
785
 
785
 
786
    mov  eax,50
786
    mov  eax,50
787
    mov  ebx,1
787
    mov  ebx,1
Line 788... Line 788...
788
    mov  ecx,4
788
    mov  ecx,4
Line 789... Line 789...
789
    int  0x40
789
    mcall
Line 807... Line 807...
807
 
807
 
808
    mov  eax,46
808
    mov  eax,46
809
    mov  ebx,0
809
    mov  ebx,0
810
    mov  ecx,0x3f0
810
    mov  ecx,0x3f0
811
    mov  edx,0x3ff
811
    mov  edx,0x3ff
Line 812... Line 812...
812
    int  0x40
812
    mcall
813
 
813
 
814
    mov  eax,45
814
    mov  eax,45
815
    mov  ebx,0
815
    mov  ebx,0
Line 816... Line 816...
816
    mov  ecx,4
816
    mov  ecx,4
817
    int  0x40
817
    mcall
818
 
818
 
Line 819... Line 819...
819
    mov  eax,40
819
    mov  eax,40
Line 820... Line 820...
820
    mov  ebx,10000b shl 16 + 111b
820
    mov  ebx,10000b shl 16 + 111b
Line 839... Line 839...
839
 
839
 
Line 840... Line 840...
840
    inc  [next_tic]
840
    inc  [next_tic]
841
 
841
 
842
    mov  eax,12                    ; function 12:tell os about windowdraw
842
    mov  eax,12                    ; function 12:tell os about windowdraw
843
    mov  ebx,1                     ; 1, start of draw
843
    mov  ebx,1                     ; 1, start of draw
844
    int  0x40
844
    mcall
845
                                   ; DRAW WINDOW
845
                                   ; DRAW WINDOW
846
    mov  eax,0                     ; function 0 : define and draw window
846
    mov  eax,0                     ; function 0 : define and draw window
847
    mov  ebx,100*65536+320         ; [x start] *65536 + [x size]
847
    mov  ebx,100*65536+320         ; [x start] *65536 + [x size]
848
    mov  ecx,100*65536+140         ; [y start] *65536 + [y size]
848
    mov  ecx,100*65536+140         ; [y start] *65536 + [y size]
849
    mov  edx,[bgr]
-
 
850
    add  edx,0x03000000            ; color of work area RRGGBB,8->color gl
849
    mov  edx,[bgr]
851
    mov  esi,0x808844ee
850
    or   edx,0x13000000            ; color of work area RRGGBB,8->color gl
852
    mov  edi,0x008844ee            ; color of frames    RRGGBB
851
    mov  edi,title                 ; WINDOW LABEL
853
    int  0x40
-
 
854
 
-
 
855
                                   ; WINDOW LABEL
-
 
856
    mov  eax,4                     ; function 4 : write text to window
-
 
857
    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
-
 
858
    mov  ecx,0x10ffffff            ; color of text RRGGBB
-
 
859
    mov  edx,labelt                ; pointer to text beginning
-
 
Line 860... Line 852...
860
    mov  esi,labellen-labelt       ; text length
852
    mcall
861
    int  0x40
853
 
862
 
854
                                   
863
    mov  eax,8                     ; START/STOP  - id 2
855
    mov  eax,8                     ; START/STOP  - id 2
864
    mov  ebx,24*65536+77
856
    mov  ebx,24*65536+77
865
    mov  ecx,80*65536+16
857
    mov  ecx,80*65536+16
Line 866... Line 858...
866
    mov  edx,2
858
    mov  edx,2
867
    mov  esi,[border]
859
    mov  esi,[border]
868
    int  0x40
860
    mcall
869
 
861
 
870
    inc  edx                       ; << / >>     - id 3 , 4
862
    inc  edx                       ; << / >>     - id 3 , 4
871
    add  ebx,86*65536-57
863
    add  ebx,86*65536-57
872
    mov  eax,8
864
    mov  eax,8
873
    int  0x40
865
    mcall
Line 874... Line 866...
874
    inc  edx
866
    inc  edx
875
    add  ebx,24*65536
867
    add  ebx,24*65536
876
    mov  eax,8
868
    mov  eax,8
877
    int  0x40
869
    mcall
Line 878... Line 870...
878
 
870
 
879
    mov  eax,8                      ; REPEAT
871
    mov  eax,8                      ; REPEAT
880
    add  ebx,29*65536+54
872
    add  ebx,29*65536+54
881
    inc  edx
873
    inc  edx
882
    int  0x40
874
    mcall
Line 883... Line 875...
883
 
875
 
884
    mov  eax,8                      ; enable infrared
876
    mov  eax,8                      ; enable infrared
885
    add  ebx,98*65536-33
877
    add  ebx,98*65536-33
886
    add  ecx,10*65536+10
878
    add  ecx,10*65536+10
887
    inc  edx
879
    inc  edx
888
    int  0x40
880
    mcall
889
 
881
 
Line 890... Line 882...
890
    pusha
882
    pusha
891
    mov  eax,8
883
    mov  eax,8
892
    mov  ebx,25*65536+9
884
    mov  ebx,25*65536+9
893
    mov  ecx,115*65536+9
885
    mov  ecx,115*65536+9
894
    inc  edx
886
    inc  edx
895
    int  0x40
887
    mcall
896
    popa
888
    popa
897
 
889
 
898
    mov  eax,4
890
    mov  eax,4
899
    shr  ecx,16
891
    shr  ecx,16
900
    mov  bx,cx
892
    mov  bx,cx
901
    add  ebx,2*65536+4
893
    add  ebx,2*65536+4
Line 902... Line 894...
902
    mov  ecx,0xffffff
894
    mov  ecx,0xffffff
903
    mov  edx,infrared_text
895
    mov  edx,infrared_text
904
    mov  esi,10
896
    mov  esi,10
905
    int  0x40
897
    mcall
906
    add  ebx,11
898
    add  ebx,11
907
    add  edx,10
899
    add  edx,10
908
    mov  eax,4
900
    mov  eax,4
909
    int  0x40
901
    mcall
910
 
902
 
911
    mov  ebx,25*65536+35           ; draw info text with function 4
903
    mov  ebx,25*65536+35           ; draw info text with function 4
912
    mov  ecx,[textc]
904
    mov  ecx,[textc]
Line 924... Line 916...
924
 
916
 
Line 925... Line 917...
925
    call draw_wave
917
    call draw_wave
926
 
918
 
927
    mov  eax,12
919
    mov  eax,12
Line 928... Line 920...
928
    mov  ebx,2
920
    mov  ebx,2
929
    int  0x40
921
    mcall
Line 942... Line 934...
942
 
934
 
943
    mov   eax,13
935
    mov   eax,13
944
    mov   ebx,260*65536+43
936
    mov   ebx,260*65536+43
945
    mov   ecx,42*65536+32
937
    mov   ecx,42*65536+32
946
    mov   edx,[border]
938
    mov   edx,[border]
Line 947... Line 939...
947
    int   0x40
939
    mcall
948
 
940
 
949
    mov   esi,[playposition]
941
    mov   esi,[playposition]
950
    mov   ebx,260
942
    mov   ebx,260
951
   npix:
943
   npix:
952
    mov   eax,1
944
    mov   eax,1
953
    inc   ebx
945
    inc   ebx
954
    movzx ecx,byte [esi]
946
    movzx ecx,byte [esi]
955
    shr   ecx,3
947
    shr   ecx,3
956
    add   ecx,42
948
    add   ecx,42
Line 957... Line 949...
957
    mov   edx,[drawc];0x2255aa
949
    mov   edx,[drawc];0x2255aa
Line 958... Line 950...
958
    int   0x40
950
    mcall
959
 
951
 
Line 1001... Line 993...
1001
wavfile:
993
wavfile:
1002
    db '/HD/1/MENUET/MUSIC/FILE7.WAV',0
994
    db '/HD/1/MENUET/MUSIC/FILE7.WAV',0
1003
    db '                                        '
995
    db '                                        '
Line 1004... Line -...
1004
 
-
 
1005
 
996
 
1006
labelt:
-
 
Line 1007... Line 997...
1007
      db   ' WAVE PLAYER  :  8b Mono - 16b Stereo'
997