> compile NEMU

221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 22:48:51 up 2 days, 17:54,  1 user,  load average: 1.76, 1.45, 1.32
This commit is contained in:
tracer-ics2023
2024-09-19 22:48:52 +08:00
committed by zzy
parent 656fe58a2f
commit 89198167c1

View File

@ -30,16 +30,26 @@ enum {
static uint8_t *sbuf = NULL;
static uint32_t *audio_base = NULL;
// static void init_sdl_audio() {
// SDL_AudioSpec s = {};
// s.format = AUDIO_S16SYS; // 假设系统中音频数据的格式总是使用16位有符号数来表示
// s.userdata = NULL; // 不使用
// SDL_InitSubSystem(SDL_INIT_AUDIO);
// SDL_OpenAudio(&s, NULL);
// SDL_PauseAudio(0);
// }
static void audio_io_handler(uint32_t offset, int len, bool is_write) {
}
void init_audio() {
uint32_t space_size = sizeof(uint32_t) * nr_reg;
audio_base = (uint32_t *)new_space(space_size);
audio_base = (uint32_t *)new_space(24);
#ifdef CONFIG_HAS_PORT_IO
add_pio_map ("audio", CONFIG_AUDIO_CTL_PORT, audio_base, space_size, audio_io_handler);
add_pio_map ("audio", CONFIG_AUDIO_CTL_PORT, audio_base, 24, audio_io_handler);
#else
add_mmio_map("audio", CONFIG_AUDIO_CTL_MMIO, audio_base, space_size, audio_io_handler);
add_mmio_map("audio", CONFIG_AUDIO_CTL_MMIO, audio_base, 24, audio_io_handler);
#endif
sbuf = (uint8_t *)new_space(CONFIG_SB_SIZE);