Subversion Repositories Kolibri OS

Rev

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

Rev 3539 Rev 5077
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
-
 
8
format PE DLL native 0.05
Line 8... Line 9...
8
format MS COFF
9
entry START
Line 9... Line -...
9
 
-
 
10
DEBUG           equ 1
10
 
Line 11... Line 11...
11
 
11
include '../struct.inc'
Line 12... Line 12...
12
include 'proc32.inc'
12
 
Line 272... Line 272...
272
    .codec_mem_base   dd ?
272
    .codec_mem_base   dd ?
273
    .ctrl_mem_base    dd ?
273
    .ctrl_mem_base    dd ?
274
    .codec_id         dd ?
274
    .codec_id         dd ?
275
}
275
}
Line 276... Line -...
276
 
-
 
277
struc IOCTL
-
 
278
{  .handle            dd ?
-
 
279
   .io_code           dd ?
-
 
280
   .input             dd ?
-
 
281
   .inp_size          dd ?
-
 
282
   .output            dd ?
-
 
283
   .out_size          dd ?
-
 
284
}
-
 
285
 
-
 
286
virtual at 0
-
 
287
  IOCTL IOCTL
-
 
288
end virtual
-
 
289
 
276
 
Line 290... Line 277...
290
EVENT_NOTIFY    equ 0x00000200
277
EVENT_NOTIFY    equ 0x00000200
291
 
278
 
292
public START
279
section '.flat' code readable executable
293
public service_proc
-
 
294
public version
280
include '../macros.inc'
Line 295... Line 281...
295
 
281
include '../proc32.inc'
Line 296... Line 282...
296
section '.flat' code readable align 16
282
include '../peimport.inc'
297
 
283
 
Line 298... Line 284...
298
proc START stdcall, state:dword
284
proc START c uses ebx esi edi, state:dword, cmdline:dword
299
 
285
 
300
        cmp     [state], 1
286
        cmp     [state], 1
301
        jne     .stop
287
        jne     .stop
Line 302... Line 288...
302
 
288
 
303
     if DEBUG
289
     if DEBUG
304
        mov     esi, msgInit
290
        mov     esi, msgInit
Line 305... Line 291...
305
        call    SysMsgBoardStr
291
        invoke  SysMsgBoardStr
306
     end if
292
     end if
307
 
293
 
308
        call    detect_controller
294
        call    detect_controller
309
        test    eax, eax
295
        test    eax, eax
Line 310... Line 296...
310
        jz      .fail
296
        jz      .fail
Line 311... Line 297...
311
 
297
 
312
     if DEBUG
298
     if DEBUG
Line 327... Line 313...
327
 
313
 
328
        call    reset_controller
314
        call    reset_controller
Line 329... Line 315...
329
        call    setup_codec
315
        call    setup_codec
330
 
316
 
331
        mov     esi, msgPrimBuff
317
        mov     esi, msgPrimBuff
332
        call    SysMsgBoardStr
318
        invoke  SysMsgBoardStr
333
        call    create_primary_buff
319
        call    create_primary_buff
Line 334... Line 320...
334
        mov     esi, msgDone
320
        mov     esi, msgDone
335
        call    SysMsgBoardStr
321
        invoke  SysMsgBoardStr
336
 
322
 
Line 358... Line 344...
358
        bts     ax, IRQ_LINE
344
        bts     ax, IRQ_LINE
359
        out     dx, al                     ;set level-triggered mode
345
        out     dx, al                     ;set level-triggered mode
360
        mov     [ctrl.int_line], IRQ_LINE
346
        mov     [ctrl.int_line], IRQ_LINE
361
        popf
347
        popf
362
        mov     esi, msgRemap
348
        mov     esi, msgRemap
363
        call    SysMsgBoardStr
349
        invoke  SysMsgBoardStr
364
  end if
350
  end if
Line 365... Line 351...
365
 
351
 
366
        mov     ebx, [ctrl.int_line]
352
        mov     ebx, [ctrl.int_line]
367
        stdcall AttachIntHandler, ebx, ac97_irq, dword 0
353
        invoke  AttachIntHandler, ebx, ac97_irq, 0
368
.reg:
354
.reg:
369
        stdcall RegService, sz_sound_srv, service_proc
355
        invoke  RegService, sz_sound_srv, service_proc
370
        ret
356
        ret
371
.fail:
357
.fail:
372
     if DEBUG
358
     if DEBUG
373
        mov     esi, msgFail
359
        mov     esi, msgFail
374
        call    SysMsgBoardStr
360
        invoke  SysMsgBoardStr
375
     end if
361
     end if
376
        xor     eax, eax
362
        xor     eax, eax
377
        ret
363
        ret
378
.fail_msg:
364
.fail_msg:
379
        call    SysMsgBoardStr
365
        invoke  SysMsgBoardStr
380
        xor     eax, eax
366
        xor     eax, eax
381
        ret
367
        ret
382
.stop:
368
.stop:
383
        call    stop
369
        call    stop
Line 411... Line 397...
411
@@:
397
@@:
412
        cmp     eax, DEV_PLAY
398
        cmp     eax, DEV_PLAY
413
        jne     @F
399
        jne     @F
414
     if DEBUG
400
     if DEBUG
415
        mov     esi, msgPlay
401
        mov     esi, msgPlay
416
        call    SysMsgBoardStr
402
        invoke  SysMsgBoardStr
417
     end if
403
     end if
418
        call    play
404
        call    play
419
        ret
405
        ret
420
@@:
406
@@:
421
        cmp     eax, DEV_STOP
407
        cmp     eax, DEV_STOP
422
        jne     @F
408
        jne     @F
423
     if DEBUG
409
     if DEBUG
424
        mov     esi, msgStop
410
        mov     esi, msgStop
425
        call    SysMsgBoardStr
411
        invoke  SysMsgBoardStr
426
     end if
412
     end if
427
        call    stop
413
        call    stop
428
        ret
414
        ret
429
@@:
415
@@:
430
        cmp     eax, DEV_CALLBACK
416
        cmp     eax, DEV_CALLBACK
Line 482... Line 468...
482
align 4
468
align 4
483
proc ac97_irq
469
proc ac97_irq
Line 484... Line 470...
484
 
470
 
485
     if DEBUG_IRQ
471
     if DEBUG_IRQ
486
        mov     esi, msgIRQ
472
        mov     esi, msgIRQ
487
        call    SysMsgBoardStr
473
        invoke  SysMsgBoardStr
Line 488... Line 474...
488
     end if
474
     end if
489
 
475
 
Line 506... Line 492...
506
        ret
492
        ret
Line 507... Line 493...
507
 
493
 
508
.do_intr:
494
.do_intr:
Line 509... Line 495...
509
        push    eax
495
        push    eax
510
 
496
 
511
        mov     edx, PCM_OUT_CR_REG
497
;        mov     edx, PCM_OUT_CR_REG
Line 512... Line 498...
512
        mov     al, 0x10;               0x10
498
;        mov     al, 0x10;               0x10
513
        call    [ctrl.ctrl_write8]
499
;        call    [ctrl.ctrl_write8]
514
 
500
 
Line 529... Line 515...
529
        mov     [ctrl.lvi_reg], eax
515
        mov     [ctrl.lvi_reg], eax
Line 530... Line 516...
530
 
516
 
531
        mov     edx, PCM_OUT_LVI_REG
517
        mov     edx, PCM_OUT_LVI_REG
Line 532... Line 518...
532
        call    [ctrl.ctrl_write8]
518
        call    [ctrl.ctrl_write8]
533
 
519
 
534
        mov     edx, PCM_OUT_CR_REG
520
;        mov     edx, PCM_OUT_CR_REG
535
        mov     ax, 0x11             ;0x1D
-
 
536
        call    [ctrl.ctrl_write8]
-
 
537
 
-
 
538
        mov     eax, [civ_val]
-
 
539
        add     eax, 1
-
 
Line 540... Line 521...
540
        and     eax, 31
521
;        mov     ax, 0x11             ;0x1D
541
        mov     ebx, dword [buff_list+eax*4]
522
;        call    [ctrl.ctrl_write8]
Line -... Line 523...
-
 
523
 
542
 
524
        cmp     [ctrl.user_callback], 0
-
 
525
        je      .done
543
        cmp     [ctrl.user_callback], 0
526
 
544
        je      .done
527
        mov     eax, [ctrl.lvi_reg]
545
 
528
        stdcall [ctrl.user_callback], [buff_list+eax*4]
546
        stdcall [ctrl.user_callback], ebx
529
 
547
.done:
530
.done:
548
        pop     eax
531
        pop     eax
549
        and     eax, 0x40
532
        and     eax, 0x40
550
        mov     edx, CTRL_STAT
533
        mov     edx, CTRL_STAT
551
        call    [ctrl.ctrl_write32]
534
        call    [ctrl.ctrl_write32]
552
        or      eax, 1
535
        or      eax, 1
553
        ret
536
        ret
554
.skip:
537
.skip:
555
        mov     edx, PCM_OUT_CR_REG
538
;        mov     edx, PCM_OUT_CR_REG
Line 556... Line 539...
556
        mov     ax, 0x11              ;0x1D
539
;        mov     ax, 0x11              ;0x1D
557
        call    [ctrl.ctrl_write8]
540
;        call    [ctrl.ctrl_write8]
Line 558... Line 541...
558
        jmp     .done
541
        jmp     .done
559
endp
542
endp
Line 560... Line 543...
560
 
543
 
561
align 4
544
align 4
562
proc create_primary_buff
545
proc create_primary_buff
563
 
546
 
564
        stdcall KernelAlloc, 0x10000
547
        invoke  KernelAlloc, 0x10000
Line 565... Line 548...
565
        mov     [ctrl.buffer], eax
548
        mov     [ctrl.buffer], eax
566
 
549
 
Line 567... Line 550...
567
        mov     edi, eax
550
        mov     edi, eax
568
        mov     ecx, 0x10000/4
551
        mov     ecx, 0x10000/4
569
        xor     eax, eax
552
        xor     eax, eax
570
        cld
553
        cld
Line 622... Line 605...
622
        add     edi, 4
605
        add     edi, 4
623
        loop    @B
606
        loop    @B
Line 624... Line 607...
624
 
607
 
625
        mov     eax, pcmout_bdl
608
        mov     eax, pcmout_bdl
626
        mov     ebx, eax
609
        mov     ebx, eax
627
        call    GetPgAddr     ;eax
610
        invoke  GetPgAddr     ;eax
628
        and     ebx, 0xFFF
611
        and     ebx, 0xFFF
Line 629... Line 612...
629
        add     eax, ebx
612
        add     eax, ebx
630
 
613
 
Line 638... Line 621...
638
        ret
621
        ret
639
endp
622
endp
Line 640... Line 623...
640
 
623
 
641
align 4
624
align 4
642
proc detect_controller
-
 
643
           locals
-
 
644
             last_bus dd ?
-
 
645
             bus      dd ?
-
 
646
             devfn    dd ?
-
 
647
           endl
-
 
648
 
625
proc detect_controller
649
        xor     eax, eax
-
 
650
        mov     [bus], eax
626
        push    ebx edi
651
        inc     eax
-
 
652
        call    PciApi
627
        invoke  GetPCIList
653
        cmp     eax, -1
-
 
654
        je      .err
-
 
655
 
-
 
656
        mov     [last_bus], eax
-
 
657
 
-
 
658
.next_bus:
-
 
659
        and     [devfn], 0
628
        mov     ebx, eax
660
.next_dev:
629
.next_dev:
661
        stdcall PciRead32, [bus], [devfn], dword 0
630
        mov     eax, [eax+PCIDEV.fd]
662
        test    eax, eax
631
        cmp     eax, ebx
663
        jz      .next
632
        jz      .not_found
664
        cmp     eax, -1
-
 
Line 665... Line 633...
665
        je      .next
633
        mov     edx, [eax+PCIDEV.vendor_device_id]
666
 
634
 
667
        mov     edi, devices
635
        mov     edi, devices
668
@@:
-
 
669
        mov     ebx, [edi]
636
@@:
670
        test    ebx, ebx
-
 
671
        jz      .next
637
        cmp     dword [edi], 0
672
 
638
        jz      .next_dev
673
        cmp     eax, ebx
639
        cmp     edx, [edi]
674
        je      .found
640
        jz      .found
675
        add     edi, 12
641
        add     edi, 12
676
        jmp     @B
-
 
677
.next:
-
 
678
        inc     [devfn]
-
 
679
        cmp     [devfn], 256
-
 
680
        jb      .next_dev
642
        jmp     @B
681
        mov     eax, [bus]
-
 
682
        inc     eax
-
 
683
        mov     [bus], eax
-
 
684
        cmp     eax, [last_bus]
643
 
-
 
644
.not_found:
685
        jna     .next_bus
645
        xor     eax, eax
686
        xor     eax, eax
646
        pop     edi ebx
687
        ret
647
        ret
688
.found:
648
.found:
Line 689... Line 649...
689
        mov     ebx, [bus]
649
        movzx   ebx, [eax+PCIDEV.bus]
690
        mov     [ctrl.bus], ebx
650
        mov     [ctrl.bus], ebx
Line 691... Line 651...
691
 
651
 
692
        mov     ecx, [devfn]
652
        movzx   ecx, [eax+PCIDEV.devfn]
693
        mov     [ctrl.devfn], ecx
653
        mov     [ctrl.devfn], ecx
694
 
654
 
695
        mov     edx, eax
655
        mov     eax, edx
Line 696... Line 656...
696
        and     edx, 0xFFFF
656
        and     edx, 0xFFFF
697
        mov     [ctrl.vendor], edx
657
        mov     [ctrl.vendor], edx
698
        shr     eax, 16
658
        shr     eax, 16
699
        mov     [ctrl.dev_id], eax
659
        mov     [ctrl.dev_id], eax
Line 700... Line 660...
700
 
660
 
701
        mov     ebx, [edi+4]
661
        mov     ebx, [edi+4]
702
        mov     [ctrl.ctrl_ids], ebx
662
        mov     [ctrl.ctrl_ids], ebx
-
 
663
        mov     eax, [edi+8]
703
        mov     esi, [edi+8]
664
        mov     [ctrl.ctrl_setup], eax
704
        mov     [ctrl.ctrl_setup], esi
665
 
705
 
666
        cmp     edx, VID_INTEL
706
        cmp     edx, VID_INTEL
667
        jne     @F
707
        jne     @F
668
        mov     [ctrl.vendor_ids], msg_Intel
-
 
669
        pop     edi ebx
708
        mov     [ctrl.vendor_ids], msg_Intel
670
        ret
709
        ret
671
@@:
710
@@:
672
        cmp     edx, VID_NVIDIA
711
        cmp     edx, VID_NVIDIA
673
        jne     @F
712
        jne     @F
674
        mov     [ctrl.vendor_ids], msg_NVidia
-
 
675
        pop     edi ebx
713
        mov     [ctrl.vendor_ids], msg_NVidia
676
        ret
714
        ret
677
@@:
Line 715... Line 678...
715
@@:
678
.err:
716
.err:
679
        xor     eax, eax
Line 717... Line 680...
717
        xor     eax, eax
680
        mov     [ctrl.vendor_ids], eax    ;something  wrong ?
718
        mov     [ctrl.vendor_ids], eax    ;something  wrong ?
681
        pop     edi ebx
719
        ret
682
        ret
720
endp
683
endp
721
 
684
 
722
align 4
685
align 4
Line 723... Line 686...
723
proc init_controller
686
proc init_controller
724
 
687
 
725
        stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 4
688
        invoke  PciRead32, [ctrl.bus], [ctrl.devfn], 4
726
        mov     ebx, eax
689
        mov     ebx, eax
Line 727... Line 690...
727
        and     eax, 0xFFFF
690
        and     eax, 0xFFFF
728
        mov     [ctrl.pci_cmd], eax
691
        mov     [ctrl.pci_cmd], eax
729
        shr     ebx, 16
692
        shr     ebx, 16
730
        mov     [ctrl.pci_stat], ebx
693
        mov     [ctrl.pci_stat], ebx
731
 
694
 
Line 732... Line 695...
732
        mov     esi, msgPciCmd
695
        mov     esi, msgPciCmd
733
        call    SysMsgBoardStr
696
        invoke  SysMsgBoardStr
Line 734... Line 697...
734
        call    dword2str
697
        call    dword2str
Line 735... Line 698...
735
        call    SysMsgBoardStr
698
        invoke  SysMsgBoardStr
736
 
699
 
Line 737... Line 700...
737
        mov     esi, msgPciStat
700
        mov     esi, msgPciStat
738
        call    SysMsgBoardStr
701
        invoke  SysMsgBoardStr
Line 739... Line 702...
739
        mov     eax, [ctrl.pci_stat]
702
        mov     eax, [ctrl.pci_stat]
740
        call    dword2str
703
        call    dword2str
Line 741... Line 704...
741
        call    SysMsgBoardStr
704
        invoke  SysMsgBoardStr
Line 742... Line 705...
742
 
705
 
743
        mov     esi, msgMixIsaIo
706
        mov     esi, msgMixIsaIo
Line 744... Line 707...
744
        call    SysMsgBoardStr
707
        invoke  SysMsgBoardStr
745
 
708
 
Line 746... Line 709...
746
        stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 0x10
709
        invoke  PciRead32, [ctrl.bus], [ctrl.devfn], 0x10
747
 
710
 
Line 748... Line 711...
748
        call    dword2str
711
        call    dword2str
749
        call    SysMsgBoardStr
712
        invoke  SysMsgBoardStr
Line 750... Line 713...
750
 
713
 
751
        and     eax, 0xFFFE
714
        and     eax, 0xFFFE
Line 752... Line 715...
752
        mov     [ctrl.codec_io_base], eax
715
        mov     [ctrl.codec_io_base], eax
753
 
716
 
Line 754... Line 717...
754
        mov     esi, msgCtrlIsaIo
717
        mov     esi, msgCtrlIsaIo
755
        call    SysMsgBoardStr
718
        invoke  SysMsgBoardStr
Line 756... Line 719...
756
 
719
 
757
        stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 0x14
720
        invoke  PciRead32, [ctrl.bus], [ctrl.devfn], 0x14
Line 758... Line 721...
758
 
721
 
Line 759... Line 722...
759
        call    dword2str
722
        call    dword2str
760
        call    SysMsgBoardStr
723
        invoke  SysMsgBoardStr
761
 
724
 
Line 762... Line 725...
762
        and     eax, 0xFFC0
725
        and     eax, 0xFFC0
763
        mov     [ctrl.ctrl_io_base], eax
726
        mov     [ctrl.ctrl_io_base], eax
764
 
727
 
765
        mov     esi, msgMixMMIo
728
        mov     esi, msgMixMMIo
766
        call    SysMsgBoardStr
729
        invoke  SysMsgBoardStr
767
 
730
 
768
        stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 0x18
731
        invoke  PciRead32, [ctrl.bus], [ctrl.devfn], 0x18
769
        mov     [ctrl.codec_mem_base], eax
732
        mov     [ctrl.codec_mem_base], eax
770
 
733
 
771
        call    dword2str
734
        call    dword2str
772
        call    SysMsgBoardStr
735
        invoke  SysMsgBoardStr
Line 773... Line 736...
773
 
736
 
774
        mov     esi, msgCtrlMMIo
737
        mov     esi, msgCtrlMMIo
775
        call    SysMsgBoardStr
738
        invoke  SysMsgBoardStr
776
 
739
 
777
        stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 0x1C
740
        invoke  PciRead32, [ctrl.bus], [ctrl.devfn], 0x1C
Line 778... Line 741...
778
        mov     [ctrl.ctrl_mem_base], eax
741
        mov     [ctrl.ctrl_mem_base], eax
779
 
742
 
780
        call    dword2str
743
        call    dword2str
Line 781... Line 744...
781
        call    SysMsgBoardStr
744
        invoke  SysMsgBoardStr
Line 835... Line 798...
835
PG_NOCACHE       equ 0x018
798
PG_NOCACHE       equ 0x018
Line 836... Line 799...
836
 
799
 
837
align 4
800
align 4
Line 838... Line 801...
838
proc set_ICH4
801
proc set_ICH4
839
 
802
 
Line 840... Line 803...
840
        stdcall MapIoMem, [ctrl.codec_mem_base], 0x1000, PG_SW+PG_NOCACHE
803
        invoke  MapIoMem, [ctrl.codec_mem_base], 0x1000, PG_SW+PG_NOCACHE
841
        mov     [ctrl.codec_mem_base], eax
804
        mov     [ctrl.codec_mem_base], eax
Line 842... Line 805...
842
 
805
 
843
        stdcall MapIoMem, [ctrl.ctrl_mem_base], 0x1000, PG_SW+PG_NOCACHE
806
        invoke  MapIoMem, [ctrl.ctrl_mem_base], 0x1000, PG_SW+PG_NOCACHE
Line 886... Line 849...
886
           locals
849
           locals
887
             counter dd ?
850
             counter dd ?
888
           endl
851
           endl
Line 889... Line 852...
889
 
852
 
890
        mov     esi, msgControl
853
        mov     esi, msgControl
Line 891... Line 854...
891
        call    SysMsgBoardStr
854
        invoke  SysMsgBoardStr
892
 
855
 
893
        mov     edx, GLOB_CTRL
856
        mov     edx, GLOB_CTRL
894
        call    [ctrl.ctrl_read32]
857
        call    [ctrl.ctrl_read32]
Line 895... Line 858...
895
        call    dword2str
858
        call    dword2str
896
        call    SysMsgBoardStr
859
        invoke  SysMsgBoardStr
Line 897... Line 860...
897
 
860
 
898
        mov     esi, msgStatus
861
        mov     esi, msgStatus
899
        call    SysMsgBoardStr
862
        invoke  SysMsgBoardStr
900
 
863
 
901
        mov     edx, CTRL_STAT
864
        mov     edx, CTRL_STAT
902
        call    [ctrl.ctrl_read32]
865
        call    [ctrl.ctrl_read32]
903
        push    eax
866
        push    eax
904
        call    dword2str
867
        call    dword2str
Line 905... Line 868...
905
        call    SysMsgBoardStr
868
        invoke  SysMsgBoardStr
Line 966... Line 929...
966
        call    cold_reset
929
        call    cold_reset
967
        jnc     .ok
930
        jnc     .ok
Line 968... Line 931...
968
 
931
 
969
     if DEBUG
932
     if DEBUG
970
        mov     esi, msgCFail
933
        mov     esi, msgCFail
971
        call    SysMsgBoardStr
934
        invoke  SysMsgBoardStr
972
           end if
935
           end if
973
        xor     eax, eax    ; timeout error
936
        xor     eax, eax    ; timeout error
974
        ret
937
        ret
975
.ok:
938
.ok:
976
     if DEBUG
939
     if DEBUG
977
        mov     esi, msgResetOk
940
        mov     esi, msgResetOk
978
        call    SysMsgBoardStr
941
        invoke  SysMsgBoardStr
Line 979... Line 942...
979
     end if
942
     end if
980
 
943
 
981
        xor     eax, eax
944
        xor     eax, eax
Line 993... Line 956...
993
        mov     edx, GLOB_CTRL
956
        mov     edx, GLOB_CTRL
994
        call    [ctrl.ctrl_write32]
957
        call    [ctrl.ctrl_write32]
Line 995... Line 958...
995
 
958
 
996
     if DEBUG
959
     if DEBUG
997
        mov     esi, msgWarm
960
        mov     esi, msgWarm
998
        call    SysMsgBoardStr
961
        invoke  SysMsgBoardStr
Line 999... Line 962...
999
     end if
962
     end if
1000
 
963
 
1001
        mov     [counter], 10   ; total 10*100 ms = 1s
964
        mov     [counter], 10   ; total 10*100 ms = 1s
Line 1011... Line 974...
1011
        dec     [counter]
974
        dec     [counter]
1012
        jnz     .wait
975
        jnz     .wait
Line 1013... Line 976...
1013
 
976
 
1014
     if DEBUG
977
     if DEBUG
1015
        mov     esi, msgWRFail
978
        mov     esi, msgWRFail
1016
        call    SysMsgBoardStr
979
        invoke  SysMsgBoardStr
1017
     end if
980
     end if
1018
.fail:
981
.fail:
1019
        stc
982
        stc
1020
        ret
983
        ret
Line 1033... Line 996...
1033
        mov     edx, GLOB_CTRL
996
        mov     edx, GLOB_CTRL
1034
        call    [ctrl.ctrl_write32]
997
        call    [ctrl.ctrl_write32]
Line 1035... Line 998...
1035
 
998
 
1036
     if DEBUG
999
     if DEBUG
1037
        mov     esi, msgCold
1000
        mov     esi, msgCold
1038
        call    SysMsgBoardStr
1001
        invoke  SysMsgBoardStr
Line 1039... Line 1002...
1039
     end if
1002
     end if
1040
 
1003
 
Line 1055... Line 1018...
1055
        dec     [counter]
1018
        dec     [counter]
1056
        jnz     .wait
1019
        jnz     .wait
Line 1057... Line 1020...
1057
 
1020
 
1058
     if DEBUG
1021
     if DEBUG
1059
        mov     esi, msgCRFail
1022
        mov     esi, msgCRFail
1060
        call    SysMsgBoardStr
1023
        invoke  SysMsgBoardStr
Line 1061... Line 1024...
1061
     end if
1024
     end if
1062
 
1025
 
1063
.fail:
1026
.fail:
1064
        stc
1027
        stc
1065
        ret
1028
        ret
1066
.ok:
1029
.ok:
Line 1067... Line 1030...
1067
        mov     esi, msgControl
1030
        mov     esi, msgControl
1068
        call    SysMsgBoardStr
1031
        invoke  SysMsgBoardStr
1069
 
1032
 
1070
        mov     edx, GLOB_CTRL
1033
        mov     edx, GLOB_CTRL
Line 1071... Line 1034...
1071
        call    [ctrl.ctrl_read32]
1034
        call    [ctrl.ctrl_read32]
1072
        call    dword2str
1035
        call    dword2str
Line 1073... Line 1036...
1073
        call    SysMsgBoardStr
1036
        invoke  SysMsgBoardStr
1074
 
1037
 
1075
        mov     esi, msgStatus
1038
        mov     esi, msgStatus
1076
        call    SysMsgBoardStr
1039
        invoke  SysMsgBoardStr
1077
 
1040
 
1078
        mov     edx, CTRL_STAT
1041
        mov     edx, CTRL_STAT
Line 1079... Line 1042...
1079
        call    [ctrl.ctrl_read32]
1042
        call    [ctrl.ctrl_read32]
1080
        push    eax
1043
        push    eax
1081
        call    dword2str
1044
        call    dword2str
Line 1436... Line 1399...
1436
        dd (CTRL_MCP51   shl 16)+VID_NVIDIA,msg_MCP51,set_ICH
1399
        dd (CTRL_MCP51   shl 16)+VID_NVIDIA,msg_MCP51,set_ICH
Line 1437... Line 1400...
1437
 
1400
 
Line 1438... Line -...
1438
        dd 0    ;terminator
-
 
1439
 
-
 
1440
 
1401
        dd 0    ;terminator
1441
version      dd (5 shl 16) or (API_VERSION and 0xFFFF)
1402
 
1442
 
1403
 
1443
msg_ICH      db '802801AA (ICH)',  13,10, 0
1404
msg_ICH      db '802801AA (ICH)',  13,10, 0
1444
msg_ICH0     db '802801AB (ICH0)', 13,10, 0
1405
msg_ICH0     db '802801AB (ICH0)', 13,10, 0
Line 1493... Line 1454...
1493
msgMixIsaIo  db 'codec io base        ',0
1454
msgMixIsaIo  db 'codec io base        ',0
1494
msgCtrlMMIo  db 'controller mmio base ',0
1455
msgCtrlMMIo  db 'controller mmio base ',0
1495
msgMixMMIo   db 'codec mmio base      ',0
1456
msgMixMMIo   db 'codec mmio base      ',0
1496
msgIrqMap    db 'AC97 irq map as      ',0
1457
msgIrqMap    db 'AC97 irq map as      ',0
Line -... Line 1458...
-
 
1458
 
-
 
1459
align 4
-
 
1460
data fixups
-
 
1461
end data
1497
 
1462
 
Line 1498... Line 1463...
1498
section '.data' data readable writable align 16
1463
section '.data' data readable writable
1499
 
1464
 
Line 1500... Line 1465...
1500
pcmout_bdl       rq 32
1465
pcmout_bdl       rq 32