Tandy DMA behavior

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Tandy DMA behavior

Postby Corona688 » 2006-8-13 @ 20:29

I just spent days figuring out why Stargunner works on older versions of DOSbox for me but not newer ones.

It turns out that the old example dosbox.conf I've used for years and modified to my needs was crashing it because it turns on Tandy 3-voice. Which still worked in older versions because they didn't touch the DMA controller, but in newer ones, it reaches in and deletes the second DMA controller -- I guess Tandies didn't have them?

So I guess the problem isn't that StarGunner won't run on a Tandy, but that the Soundblaster code does no errorchecking at all when it fails to grab a DMA -- it should fail, not crash. And, since the behavior's changed, the Tandy code ought to give a warning when it reaches in and disables crucial portions of virtual hardware.
Corona688
Newbie
 
Posts: 2
Joined: 2006-8-13 @ 18:57

Re: Tandy DMA behavior

Postby wd » 2006-8-14 @ 07:06

You're using machine=vga AND tandy=true. In this configuration the
2nd dma controller HAS to be disabled as there are port conflicts, and
in order to get sound of the games which support vga video modes and
tandy sound simultaneously the 2nd dma controller has to be closed.

There won't be any warning as people who force some non-standard
configuration settings should know what they are doing.
And using old configuration files is VERY bad, jfi.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Tandy DMA behavior

Postby Corona688 » 2006-8-15 @ 00:24

Absolutely. As I said, that Stargunner won't work on a Tandy isn't the problem. The problem is that actually crash dosbox because the Soundblaster code doesn't bother to check if it actually gets the DMA it wants for whatever reason.
Corona688
Newbie
 
Posts: 2
Joined: 2006-8-13 @ 18:57

Re: Tandy DMA behavior

Postby wd » 2006-8-15 @ 09:05

I don't see any problem with this, you force tandy sound, which disables
the 2nd dma, which disables the soundblaster16 (regular soundblasters
work fine as they don't need the hdma channel) and have the game
configured to sb16 sound. The game writes to the 2nd dma registers
and thus messes up the tandy sound ports.
Maybe dosbox shouldn't crash by this though, will see.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Tandy DMA behavior

Postby wd » 2006-8-15 @ 09:26

The following code should work, in case you want to compile sources:
Code: Select all
static void DSP_PrepareDMA_New(DMA_MODES mode,Bitu length,bool autoinit,bool stereo) {
   Bitu freq=sb.freq;
   sb.dma.total=length;
   sb.dma.autoinit=autoinit;
   if (mode==DSP_DMA_16) {
      if (sb.hw.dma16!=0xff) {
         sb.dma.chan=GetDMAChannel(sb.hw.dma16);
         if (sb.dma.chan==NULL) {
            sb.dma.chan=GetDMAChannel(sb.hw.dma8);
            mode=DSP_DMA_16_ALIASED;
            freq/=2;
         }
      } else {
         sb.dma.chan=GetDMAChannel(sb.hw.dma8);
         mode=DSP_DMA_16_ALIASED;
         freq/=2;
      }
   } else sb.dma.chan=GetDMAChannel(sb.hw.dma8);
   DSP_DoDMATransfer(mode,freq,stereo);
}
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Tandy DMA behavior

Postby The Devil Hunter » 2006-8-26 @ 02:31

wd wrote:You're using machine=vga AND tandy=true. In this configuration the
2nd dma controller HAS to be disabled as there are port conflicts, and
in order to get sound of the games which support vga video modes and
tandy sound simultaneously the 2nd dma controller has to be closed.

There won't be any warning as people who force some non-standard
configuration settings should know what they are doing.
And using old configuration files is VERY bad, jfi.


Hey i changed teh tandy thing to off, and i got the game to run fine, thou it makes the cpu usage go up to like 66% witch makes some other programs iam running lag a bit. So is there anyway i can reslove that? Iam sure u can make dosbox not use so much cpu usage.
Mess with the best, die like the rest.
User avatar
The Devil Hunter
Newbie
 
Posts: 21
Joined: 2005-9-03 @ 00:59
Location: Fairbanks, Alaska

Re: Tandy DMA behavior

Postby wd » 2006-8-26 @ 09:46

dosbox emulates a full computer system, which is pretty cpu demanding.
Try the dynamic core and set the cycles rather low, maybe raise the
frameskip value.


> Hey i changed teh tandy thing to off

There's no need to modify the default setting.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23


Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 1 guest