First post, by DosWorld
- Rank
- Newbie
Hello!
Sorry, may be I am wrond with forum area, but here I can rights to make a post.
I have stable %subj% error and, imho, could help fix it.
1. My source code (small game) often reproduce this error. Problem good reproduced with Sound Blaster (FX) using (play FX at 8-bit mono). But works fine with real hardware (SB AWE32 => SB16, Terratec EWS-64 XXL => SB Pro). I can provide source code and binaries to reproduce it.
2. Imho, Root cause of problem. Dma controller is divided on two parts. First part (first 4 channels), aka "low dma" works in 8bit mode all time, and "hight dma" works into 16-bit mode. As I see source code of dosbox - dosbox work in 16bit mode with "low dma" channels (segment/offset wrapping). This is reason why it cause (segment/offset wrapping for 16-bit dma into 8-bit dma channels).
Here is documentation https://homepages.cae.wisc.edu/~brodskye/sb16 … oc.html#DMAProg
For 8-bit data, offset should be in bytes the start of a 64kb page:
5. Write the offset of the buffer, low byte followed by high byte. For sixteen bit data, the offset should be in words from the […]
5. Write the offset of the buffer, low byte followed by high byte. For sixteen bit data, the offset should be in words from the start of a 128kbyte page. The easiest method for computing 16-bit parameters is to divide the linear address by two before calculating offset.
if SixteenBit then
begin
BufOffset := (LinearAddr div 2) mod 65536;
Port[BaseAddrPort] := Lo(BufOffset);
Port[BaseAddrPort] := Hi(BufOffset);
end
else
begin
BufOffset := LinearAddr mod 65536;
Port[BaseAddrPort] := Lo(BufOffset);
Port[BaseAddrPort] := Hi(BufOffset);
end;
...
7. Write the buffer page to the DMA page register.
Port[PagePort] := LinearAddr div 65536;
3. If this point of view is ok, I can try prepare patch for it.
CPU: Amd K6/450, RAM: 256M, VIDEO: S3Trio V+, SOUND: EWS64XXL/64M
CPU: iP/100, RAM: 16M, VIDEO: S3Trio V+, SOUND: SB AWE32
IBM Aptiva, CPU i486DX/80, RAM: 96M
Compaq Contura 4/25 2820D, CPU: i486SX/25, RAM: 4M, VGA.
HP 200LX/2M