Commit aaaa7df6250f28e1eb1d3311140d01cd03641412
1 parent
9d4fb82e
added temporary option -enable-audio
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@768 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
18 additions
and
6 deletions
hw/pc.c
... | ... | @@ -401,9 +401,11 @@ void pc_init(int ram_size, int vga_ram_size, int boot_device, |
401 | 401 | DMA_init(); |
402 | 402 | |
403 | 403 | #ifndef _WIN32 |
404 | - /* no audio supported yet for win32 */ | |
405 | - AUD_init(); | |
406 | - SB16_init(); | |
404 | + if (audio_enabled) { | |
405 | + /* no audio supported yet for win32 */ | |
406 | + AUD_init(); | |
407 | + SB16_init(); | |
408 | + } | |
407 | 409 | #endif |
408 | 410 | |
409 | 411 | floppy_controller = fdctrl_init(6, 2, 0, 0x3f0, fd_table); | ... | ... |
vl.c
... | ... | @@ -111,6 +111,7 @@ NetDriverState nd_table[MAX_NICS]; |
111 | 111 | SerialState *serial_console; |
112 | 112 | QEMUTimer *gui_timer; |
113 | 113 | int vm_running; |
114 | +int audio_enabled = 0; | |
114 | 115 | |
115 | 116 | /***********************************************************/ |
116 | 117 | /* x86 io ports */ |
... | ... | @@ -1744,8 +1745,10 @@ int main_loop(void) |
1744 | 1745 | qemu_run_timers(&active_timers[QEMU_TIMER_VIRTUAL], |
1745 | 1746 | qemu_get_clock(vm_clock)); |
1746 | 1747 | |
1747 | - /* XXX: add explicit timer */ | |
1748 | - SB16_run(); | |
1748 | + if (audio_enabled) { | |
1749 | + /* XXX: add explicit timer */ | |
1750 | + SB16_run(); | |
1751 | + } | |
1749 | 1752 | |
1750 | 1753 | /* run dma transfers, if any */ |
1751 | 1754 | DMA_run(); |
... | ... | @@ -1761,7 +1764,7 @@ int main_loop(void) |
1761 | 1764 | |
1762 | 1765 | void help(void) |
1763 | 1766 | { |
1764 | - printf("QEMU PC emulator version " QEMU_VERSION ", Copyright (c) 2003 Fabrice Bellard\n" | |
1767 | + printf("QEMU PC emulator version " QEMU_VERSION ", Copyright (c) 2003-2004 Fabrice Bellard\n" | |
1765 | 1768 | "usage: %s [options] [disk_image]\n" |
1766 | 1769 | "\n" |
1767 | 1770 | "'disk_image' is a raw hard image image for IDE hard disk 0\n" |
... | ... | @@ -1775,6 +1778,7 @@ void help(void) |
1775 | 1778 | "-snapshot write to temporary files instead of disk image files\n" |
1776 | 1779 | "-m megs set virtual RAM size to megs MB\n" |
1777 | 1780 | "-nographic disable graphical output and redirect serial I/Os to console\n" |
1781 | + "-enable-audio enable audio support\n" | |
1778 | 1782 | "\n" |
1779 | 1783 | "Network options:\n" |
1780 | 1784 | "-nics n simulate 'n' network cards [default=1]\n" |
... | ... | @@ -1842,6 +1846,7 @@ struct option long_options[] = { |
1842 | 1846 | { "macaddr", 1, NULL, 0 }, |
1843 | 1847 | { "user-net", 0, NULL, 0 }, |
1844 | 1848 | { "dummy-net", 0, NULL, 0 }, |
1849 | + { "enable-audio", 0, NULL, 0 }, | |
1845 | 1850 | { NULL, 0, NULL, 0 }, |
1846 | 1851 | }; |
1847 | 1852 | |
... | ... | @@ -2033,6 +2038,9 @@ int main(int argc, char **argv) |
2033 | 2038 | case 19: |
2034 | 2039 | net_if_type = NET_IF_DUMMY; |
2035 | 2040 | break; |
2041 | + case 20: | |
2042 | + audio_enabled = 1; | |
2043 | + break; | |
2036 | 2044 | } |
2037 | 2045 | break; |
2038 | 2046 | case 'h': | ... | ... |
vl.h
... | ... | @@ -173,6 +173,8 @@ void qemu_del_vm_stop_handler(VMStopHandler *cb, void *opaque); |
173 | 173 | void vm_start(void); |
174 | 174 | void vm_stop(int reason); |
175 | 175 | |
176 | +extern int audio_enabled; | |
177 | + | |
176 | 178 | /* async I/O support */ |
177 | 179 | |
178 | 180 | typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size); | ... | ... |