Commit 946fc94733c9120ddc78512838d9087d01418eaa
1 parent
a0d01ed9
ES1370 word sized read fix (aka Win9x bug) (malc)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1613 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
35 additions
and
3 deletions
hw/es1370.c
... | ... | @@ -249,7 +249,7 @@ static void print_sctl (uint32_t val) |
249 | 249 | #endif |
250 | 250 | |
251 | 251 | #ifndef SILENT_ES1370 |
252 | -#define lwarn(...) AUD_log ("es1370: warning:", __VA_ARGS__) | |
252 | +#define lwarn(...) AUD_log ("es1370: warning", __VA_ARGS__) | |
253 | 253 | #else |
254 | 254 | #define lwarn(...) |
255 | 255 | #endif |
... | ... | @@ -590,6 +590,13 @@ IO_WRITE_PROTO (es1370_writel) |
590 | 590 | ldebug ("chan %d frame address %#x\n", d - &s->chan[0], val); |
591 | 591 | break; |
592 | 592 | |
593 | + case ES1370_REG_PHANTOM_FRAMECNT: | |
594 | + lwarn ("writing to phantom frame count %#x\n", val); | |
595 | + break; | |
596 | + case ES1370_REG_PHANTOM_FRAMEADR: | |
597 | + lwarn ("writing to phantom frame address %#x\n", val); | |
598 | + break; | |
599 | + | |
593 | 600 | case ES1370_REG_ADC_FRAMECNT: |
594 | 601 | d++; |
595 | 602 | case ES1370_REG_DAC2_FRAMECNT: |
... | ... | @@ -659,6 +666,22 @@ IO_READ_PROTO (es1370_readw) |
659 | 666 | val = d->scount >> 16; |
660 | 667 | break; |
661 | 668 | |
669 | + case ES1370_REG_ADC_FRAMECNT: | |
670 | + d++; | |
671 | + case ES1370_REG_DAC2_FRAMECNT: | |
672 | + d++; | |
673 | + case ES1370_REG_DAC1_FRAMECNT: | |
674 | + val = d->frame_cnt & 0xffff; | |
675 | + break; | |
676 | + | |
677 | + case ES1370_REG_ADC_FRAMECNT + 2: | |
678 | + d++; | |
679 | + case ES1370_REG_DAC2_FRAMECNT + 2: | |
680 | + d++; | |
681 | + case ES1370_REG_DAC1_FRAMECNT + 2: | |
682 | + val = d->frame_cnt >> 16; | |
683 | + break; | |
684 | + | |
662 | 685 | default: |
663 | 686 | val = ~0; |
664 | 687 | lwarn ("readw %#x -> %#x\n", addr, val); |
... | ... | @@ -736,6 +759,15 @@ IO_READ_PROTO (es1370_readl) |
736 | 759 | val = d->frame_addr; |
737 | 760 | break; |
738 | 761 | |
762 | + case ES1370_REG_PHANTOM_FRAMECNT: | |
763 | + val = ~0U; | |
764 | + lwarn ("reading from phantom frame count\n"); | |
765 | + break; | |
766 | + case ES1370_REG_PHANTOM_FRAMEADR: | |
767 | + val = ~0U; | |
768 | + lwarn ("reading from phantom frame address\n"); | |
769 | + break; | |
770 | + | |
739 | 771 | default: |
740 | 772 | val = ~0U; |
741 | 773 | lwarn ("readl %#x -> %#x\n", addr, val); |
... | ... | @@ -812,7 +844,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, |
812 | 844 | if (s->sctl & loop_sel) { |
813 | 845 | /* Bah, how stupid is that having a 0 represent true value? |
814 | 846 | i just spent few hours on this shit */ |
815 | - lwarn ("whoops non looping mode\n"); | |
847 | + AUD_log ("es1370: warning", "non looping mode\n"); | |
816 | 848 | } |
817 | 849 | else { |
818 | 850 | d->frame_cnt = size; |
... | ... | @@ -983,7 +1015,7 @@ int es1370_init (PCIBus *bus, AudioState *audio) |
983 | 1015 | -1, NULL, NULL); |
984 | 1016 | |
985 | 1017 | if (!d) { |
986 | - fprintf (stderr, "Failed to register PCI device for ES1370\n"); | |
1018 | + AUD_log (NULL, "Failed to register PCI device for ES1370\n"); | |
987 | 1019 | return -1; |
988 | 1020 | } |
989 | 1021 | ... | ... |