1
0
Fork 0

Add Beta2 patch: Fix autoexec overflow.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2729
This commit is contained in:
Peter Veenstra 2007-01-08 19:59:06 +00:00
parent fdd16dea1a
commit d78d597f92
4 changed files with 62 additions and 52 deletions

View file

@ -17,6 +17,8 @@
*/
#include <string.h>
#include <iomanip>
#include <sstream>
#include "dosbox.h"
#include "inout.h"
#include "mixer.h"
@ -26,6 +28,7 @@
#include "shell.h"
#include "math.h"
#include "regs.h"
using namespace std;
//Extra bits of precision over normal gus
#define WAVE_BITS 2
@ -82,12 +85,12 @@ struct GFGus {
float delay;
} timers[2];
Bit32u rate;
Bit16u portbase;
Bit8u dma1;
Bit8u dma2;
Bitu portbase;
Bitu dma1;
Bitu dma2;
Bit16u irq1;
Bit16u irq2;
Bitu irq1;
Bitu irq2;
char ultradir[512];
bool irqenabled;
@ -861,10 +864,15 @@ public:
myGUS.gRegData=0x0;
int portat = 0x200+GUS_BASE;
// ULTRASND=Port,DMA1,DMA2,IRQ1,IRQ2
autoexecline[0].Install("SET ULTRASND=%3X,%d,%d,%d,%d",portat,myGUS.dma1,myGUS.dma2,myGUS.irq1,myGUS.irq2);
autoexecline[1].Install("SET ULTRADIR=%s", myGUS.ultradir);
// Create autoexec.bat lines
ostringstream temp;
temp << "SET ULTRASND=" << hex << setw(3) << portat << ","
<< dec << myGUS.dma1 << "," << myGUS.dma2 << ","
<< myGUS.irq1 << "," << myGUS.irq2 << ends;
autoexecline[0].Install(temp.str());
autoexecline[1].Install(std::string("SET ULTRADIR=")+ myGUS.ultradir);
}
~GUS() {
if(machine!=MCH_VGA) return;

View file

@ -16,8 +16,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sblaster.cpp,v 1.60 2007-01-08 19:45:40 qbix79 Exp $ */
/* $Id: sblaster.cpp,v 1.61 2007-01-08 19:59:06 qbix79 Exp $ */
#include <iomanip>
#include <sstream>
#include <string.h>
#include <math.h>
#include "dosbox.h"
@ -29,6 +31,7 @@
#include "setup.h"
#include "support.h"
#include "shell.h"
using namespace std;
void MIDI_RawOutByte(Bit8u data);
bool MIDI_Available(void);
@ -141,8 +144,8 @@ struct SB_INFO {
} adpcm;
struct {
Bitu base;
Bit8u irq;
Bit8u dma8,dma16;
Bitu irq;
Bitu dma8,dma16;
} hw;
struct {
Bits value;
@ -1314,11 +1317,14 @@ public:
if (sb.type == SBT_16) sb.chan->Enable(true);
else sb.chan->Enable(false);
char hdma[8]="";
if (sb.type==SBT_16) {
sprintf(hdma,"H%d ",sb.hw.dma16);
}
autoexecline.Install("SET BLASTER=A%3X I%d D%d %sT%d",sb.hw.base,sb.hw.irq,sb.hw.dma8,hdma,sb.type);
// Create set blaster line
ostringstream temp;
temp << "SET BLASTER=A" << setw(3)<< hex << sb.hw.base
<< " I" << dec << sb.hw.irq << " D"<< sb.hw.dma8;
if (sb.type==SBT_16) temp << " H" << sb.hw.dma16;
temp << " T" << static_cast<unsigned int>(sb.type) << ends;
autoexecline.Install(temp.str());
/* Soundblaster midi interface */
if (!MIDI_Available()) sb.midi = false;