diff --git a/abstract-machine/am/src/platform/nemu/ioe/audio.c b/abstract-machine/am/src/platform/nemu/ioe/audio.c index 97dd06e..21e0035 100644 --- a/abstract-machine/am/src/platform/nemu/ioe/audio.c +++ b/abstract-machine/am/src/platform/nemu/ioe/audio.c @@ -40,9 +40,9 @@ void __am_audio_play(AM_AUDIO_PLAY_T *ctl) { i--; continue; } else { + outb(AUDIO_SBUF_ADDR + audio_write, ((uint8_t*)ctl->buf.start)[i]); + audio_write = (audio_write + 1) % audio_sbuf_size; outl(AUDIO_COUNT_ADDR, inl(AUDIO_COUNT_ADDR) + 1); } - outb(AUDIO_SBUF_ADDR + audio_write, ((uint8_t*)ctl->buf.start)[i]); - audio_write = (audio_write + 1) % audio_sbuf_size; } }