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,7 +249,7 @@ static void print_sctl (uint32_t val) | ||
249 | #endif | 249 | #endif |
250 | 250 | ||
251 | #ifndef SILENT_ES1370 | 251 | #ifndef SILENT_ES1370 |
252 | -#define lwarn(...) AUD_log ("es1370: warning:", __VA_ARGS__) | 252 | +#define lwarn(...) AUD_log ("es1370: warning", __VA_ARGS__) |
253 | #else | 253 | #else |
254 | #define lwarn(...) | 254 | #define lwarn(...) |
255 | #endif | 255 | #endif |
@@ -590,6 +590,13 @@ IO_WRITE_PROTO (es1370_writel) | @@ -590,6 +590,13 @@ IO_WRITE_PROTO (es1370_writel) | ||
590 | ldebug ("chan %d frame address %#x\n", d - &s->chan[0], val); | 590 | ldebug ("chan %d frame address %#x\n", d - &s->chan[0], val); |
591 | break; | 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 | case ES1370_REG_ADC_FRAMECNT: | 600 | case ES1370_REG_ADC_FRAMECNT: |
594 | d++; | 601 | d++; |
595 | case ES1370_REG_DAC2_FRAMECNT: | 602 | case ES1370_REG_DAC2_FRAMECNT: |
@@ -659,6 +666,22 @@ IO_READ_PROTO (es1370_readw) | @@ -659,6 +666,22 @@ IO_READ_PROTO (es1370_readw) | ||
659 | val = d->scount >> 16; | 666 | val = d->scount >> 16; |
660 | break; | 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 | default: | 685 | default: |
663 | val = ~0; | 686 | val = ~0; |
664 | lwarn ("readw %#x -> %#x\n", addr, val); | 687 | lwarn ("readw %#x -> %#x\n", addr, val); |
@@ -736,6 +759,15 @@ IO_READ_PROTO (es1370_readl) | @@ -736,6 +759,15 @@ IO_READ_PROTO (es1370_readl) | ||
736 | val = d->frame_addr; | 759 | val = d->frame_addr; |
737 | break; | 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 | default: | 771 | default: |
740 | val = ~0U; | 772 | val = ~0U; |
741 | lwarn ("readl %#x -> %#x\n", addr, val); | 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,7 +844,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, | ||
812 | if (s->sctl & loop_sel) { | 844 | if (s->sctl & loop_sel) { |
813 | /* Bah, how stupid is that having a 0 represent true value? | 845 | /* Bah, how stupid is that having a 0 represent true value? |
814 | i just spent few hours on this shit */ | 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 | else { | 849 | else { |
818 | d->frame_cnt = size; | 850 | d->frame_cnt = size; |
@@ -983,7 +1015,7 @@ int es1370_init (PCIBus *bus, AudioState *audio) | @@ -983,7 +1015,7 @@ int es1370_init (PCIBus *bus, AudioState *audio) | ||
983 | -1, NULL, NULL); | 1015 | -1, NULL, NULL); |
984 | 1016 | ||
985 | if (!d) { | 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 | return -1; | 1019 | return -1; |
988 | } | 1020 | } |
989 | 1021 |