windows - Sound Blaster emulation in NTVDM: direct mode and MPU don’t work as expected -


i’ve been trying write small program producing sound example students learn x86 assembly programming in real mode. succeeds playing sound when run dosbox fails when run in ntvdm (i use windows xp’s one).

the same trouble attempts access sound blaster in so-called direct mode (with dsp reset performed). dsp command seems work reliably me in ntvdm 0xe1 — retrieving dsp version info.

most of ms-dos programs have used produce non-internal-speaker sounds don’t work in ntvdm either. except few of them happily do.

i had similar problem internal speaker output few years ago, , turned out order of performing several initialization tasks seemed exchangeable matters in fact. time can’t find solution.

here’s test piece of code have (fasm syntax):

    include 'macro\proc16.inc'  midiport_data           = $0330 midiport_command        = $0331          org 100h  start:         stdcall midi.initialize          stdcall midi._writedata, $c0         stdcall midi._writedata, $00          stdcall midi._writedata, $90         stdcall midi._writedata, 60         stdcall midi._writedata, 127         xor     ax, ax         int     16h         ret  proc midi._writecommand\      bvalue       mov        dx, midiport_command @@:      in         al, dx      test       al, $40      jnz        @b       mov        ax, [bvalue]      out        dx, al      ret endp  proc midi._writedata\      bvalue       mov        dx, midiport_command @@:      in         al, dx      test       al, $40      jnz        @b       mov        dx, midiport_data      mov        ax, [bvalue]      out        dx, al      ret endp  proc midi.initialize      stdcall    midi._writecommand, $ff .waitack:      mov        dx, midiport_command @@:      in         al, dx      test       al, $80      jnz        @b       mov        dx, midiport_data      in         al, dx      cmp        al, $fe      jne        .waitack       stdcall    midi._writecommand, $3f      ret endp 

what reason? suggestions appreciated.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -