flat assembler
Message board for the users of flat assembler.
Index
> DOS > Sound Blaster/AdLib in NTVDM doesn’t work? |
Author |
|
Grom PE 24 Apr 2016, 07:30
NTVDM's emulation is subpar at best, even worse when you think of its sound emulation.
VDMSound project was aimed to fill this gap, so you may have some results if you retry with it installed. |
|||
24 Apr 2016, 07:30 |
|
DimonSoft 25 Apr 2016, 11:37
VDMSound didn’t really help. DOSBox made it work, but I once had similar problems with NTVDM (related to speaker control) and it turned out NTVDM is just more strict to the order of the program requests.
Since the question was asked I’ve done quite a lot of experiments. Consider the following piece of code… Code: include 'macro\proc16.inc' MIDIPORT_DATA = $0330 MIDIPORT_COMMAND = $0331 org 100h Start: stdcall MIDI.Initialize stdcall MIDI._WriteData, $90 stdcall MIDI._WriteData, $05 stdcall MIDI._WriteData, $7F ; stdcall MIDI._WriteData, $90 ; stdcall MIDI._WriteData, $60 ; stdcall MIDI._WriteData, $7F 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 DSP.Reset mov dx, $226 mov al, 1 out dx, al xor al, al @@: dec al jnz @B out dx, al mov dx, $22E @@: in al, dx test al, al jns @B mov dx, $22A in al, dx cmp al, $AA jne @B ret endp proc DSP.Write\ bData mov dx, $22C @@: in al, dx test al, al js @B mov ax, [bData] out dx, al ret endp proc DSP.Read mov dx, $22E @@: in al, dx test al, al jns @B mov dx, $22A in al, dx 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 It uses another group of ports but with the same intention. It works as expected in DOSBox but keeps silent in NTVDM. But!.. If you add another MIDI message (say, uncomment those three lines), you’ll see (or hear?) that NTVDM actually starts “executing” a message only when the next one arrives, i.e. in this case NTVDM plays 1 note while DOSBox plays 2 of them. In fact, adding any well-formed MIDI message makes the previous one work (I tried with one-byte $F4 message). Besides, when run from Turbo Debugger (in NTVDM as well) the program doesn’t work as expected for the first time but if you restart it with Ctrl + F2, the 2nd, 3rd, etc. runs work perfect!.. So, I guess it’s a matter of internal state of the emulated MPU-401 which is slightly different for NTVDM and DOSBox. But I couldn’t find any information about that. |
|||
25 Apr 2016, 11:37 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.