1
0
Fork 0

reset dma request line on soundblaster reset (thanks to hal), fixes 3d bomber

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3219
This commit is contained in:
Sebastian Strohhäcker 2008-09-13 20:04:28 +00:00
parent 74b5d82ccf
commit 5f12dea767
3 changed files with 20 additions and 5 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002-2007 The DOSBox Team
* Copyright (C) 2002-2008 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dma.h,v 1.17 2007-01-08 19:45:37 qbix79 Exp $ */
/* $Id: dma.h,v 1.18 2008-09-13 20:04:28 c2woody Exp $ */
#ifndef DOSBOX_DMA_H
#define DOSBOX_DMA_H
@ -46,6 +46,7 @@ public:
Bit8u trantype;
bool masked;
bool tcount;
bool request;
DMA_CallBack callback;
DmaChannel(Bit8u num, bool dma16);
@ -59,6 +60,8 @@ public:
void Register_Callback(DMA_CallBack _cb) {
callback = _cb;
SetMask(masked);
if (callback) Raise_Request();
else Clear_Request();
}
void ReachedTC(void) {
tcount=true;
@ -68,6 +71,12 @@ public:
pagenum=val;
pagebase=(pagenum >> DMA16) << (16+DMA16);
}
void Raise_Request(void) {
request=true;
}
void Clear_Request(void) {
request=false;
}
Bitu Read(Bitu size, Bit8u * buffer);
Bitu Write(Bitu size, Bit8u * buffer);
};

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002-2007 The DOSBox Team
* Copyright (C) 2002-2008 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,6 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dma.cpp,v 1.39 2008-09-13 20:04:28 c2woody Exp $ */
#include <string.h>
#include "dosbox.h"
#include "mem.h"
@ -231,7 +233,8 @@ Bitu DmaController::ReadControllerReg(Bitu reg,Bitu len) {
chan=GetChannel(i);
if (chan->tcount) ret|=1 << i;
chan->tcount=false;
if (chan->callback) ret|=1 << (i+4);
// if (chan->callback) ret|=1 << (i+4);
if (chan->request) ret|=1 << (4+i);
}
return ret;
default:
@ -256,6 +259,7 @@ DmaChannel::DmaChannel(Bit8u num, bool dma16) {
increment = true;
autoinit = false;
tcount = false;
request = false;
}
Bitu DmaChannel::Read(Bitu want, Bit8u * buffer) {

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sblaster.cpp,v 1.69 2008-08-28 17:37:23 c2woody Exp $ */
/* $Id: sblaster.cpp,v 1.70 2008-09-13 20:04:28 c2woody Exp $ */
#include <iomanip>
#include <sstream>
@ -680,6 +680,7 @@ static void DSP_Reset(void) {
sb.dma.autoinit=false;
sb.dma.mode=DSP_DMA_NONE;
sb.dma.remain_size=0;
if (sb.dma.chan) sb.dma.chan->Clear_Request();
sb.freq=22050;
sb.time_constant=45;
sb.dac.used=0;
@ -1482,6 +1483,7 @@ public:
if (sb.type==SBT_NONE) return;
sb.chan=MixerChan.Install(&SBLASTER_CallBack,22050,"SB");
sb.dsp.state=DSP_S_NORMAL;
sb.dma.chan=NULL;
for (i=4;i<=0xf;i++) {
if (i==8 || i==9) continue;