From 704221c89d47011878ea102ada955c70a812bd7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Tue, 23 Jun 2009 17:46:05 +0000 Subject: [PATCH] add lowlevel tandy dac implementation Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3431 --- include/hardware.h | 3 +- src/hardware/tandy_sound.cpp | 269 ++++++++++++++++++++++++++++++----- src/ints/bios.cpp | 167 +++++++++++++++++----- 3 files changed, 370 insertions(+), 69 deletions(-) diff --git a/include/hardware.h b/include/hardware.h index 8823aac9..4a440855 100644 --- a/include/hardware.h +++ b/include/hardware.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: hardware.h,v 1.16 2009-06-07 10:18:13 c2woody Exp $ */ +/* $Id: hardware.h,v 1.17 2009-06-23 17:46:05 c2woody Exp $ */ #ifndef DOSBOX_HARDWARE_H #define DOSBOX_HARDWARE_H @@ -41,6 +41,7 @@ void OPL_ShutDown(Section* sec); void CMS_ShutDown(Section* sec); bool SB_Get_Address(Bitu& sbaddr, Bitu& sbirq, Bitu& sbdma); +bool TS_Get_Address(Bitu& tsaddr, Bitu& tsirq, Bitu& tsdma); extern Bit8u adlib_commandreg; FILE * OpenCaptureFile(const char * type,const char * ext); diff --git a/src/hardware/tandy_sound.cpp b/src/hardware/tandy_sound.cpp index 9adde3a7..120ed13e 100644 --- a/src/hardware/tandy_sound.cpp +++ b/src/hardware/tandy_sound.cpp @@ -27,10 +27,10 @@ #include "setup.h" #include "pic.h" #include "dma.h" +#include "hardware.h" #include #include -#define DAC_CLOCK 3570000 #define MAX_OUTPUT 0x7fff #define STEP 0x10000 @@ -56,8 +56,7 @@ Hope that helps the System E stuff, more news on the PSG as and when! #define NG_PRESET 0x0f35 -struct SN76496 -{ +struct SN76496 { int SampleRate; unsigned int UpdateStep; int VolTable[16]; /* volume table */ @@ -72,18 +71,36 @@ struct SN76496 }; static struct SN76496 sn; + +#define TDAC_DMA_BUFSIZE 1024 + static struct { MixerChannel * chan; bool enabled; Bitu last_write; struct { - bool playing; - Bitu rate; + MixerChannel * chan; + bool enabled; + struct { + Bitu base; + Bit8u irq,dma; + } hw; + struct { + Bitu rate; + Bit8u buf[TDAC_DMA_BUFSIZE]; + Bit8u last_sample; + DmaChannel * chan; + bool transfer_done; + } dma; + Bit8u mode,control; + Bit16u frequency; + Bit8u amplitude; + bool irq_activated; } dac; } tandy; -static void SN76496Write(Bitu port,Bitu data,Bitu iolen) { +static void SN76496Write(Bitu /*port*/,Bitu data,Bitu /*iolen*/) { struct SN76496 *R = &sn; tandy.last_write=PIC_Ticks; @@ -160,8 +177,7 @@ static void SN76496Write(Bitu port,Bitu data,Bitu iolen) { } } -static void SN76496Update(Bitu length) -{ +static void SN76496Update(Bitu length) { if ((tandy.last_write+5000)Enable(false); @@ -250,7 +266,7 @@ static void SN76496Update(Bitu length) if (out > MAX_OUTPUT * STEP) out = MAX_OUTPUT * STEP; - *(buffer++) = out / STEP; + *(buffer++) = (Bit16s)(out / STEP); count--; } @@ -259,11 +275,9 @@ static void SN76496Update(Bitu length) -static void SN76496_set_clock(int clock) -{ +static void SN76496_set_clock(int clock) { struct SN76496 *R = &sn; - /* the base clock for the tone generators is the chip clock divided by 16; */ /* for the noise generator, it is clock / 256. */ /* Here we calculate the number of steps which happen during one sample */ @@ -274,20 +288,11 @@ static void SN76496_set_clock(int clock) } -static void TandyDACWrite(Bitu port,Bitu data,Bitu iolen) { - LOG_MSG("Write tandy dac %X val %X",port,data); - - -} - - -static void SN76496_set_gain(int gain) -{ +static void SN76496_set_gain(int gain) { struct SN76496 *R = &sn; int i; double out; - gain &= 0xff; /* increase max output basing on gain (0.2 dB per step) */ @@ -308,14 +313,185 @@ static void SN76496_set_gain(int gain) } + +bool TS_Get_Address(Bitu& tsaddr, Bitu& tsirq, Bitu& tsdma) { + tsaddr=0; + tsirq =0; + tsdma =0; + if (tandy.dac.enabled) { + tsaddr=tandy.dac.hw.base; + tsirq =tandy.dac.hw.irq; + tsdma =tandy.dac.hw.dma; + return true; + } + return false; +} + + +static void TandyDAC_DMA_CallBack(DmaChannel * /*chan*/, DMAEvent event) { + if (event == DMA_REACHED_TC) { + tandy.dac.dma.transfer_done=true; + PIC_ActivateIRQ(tandy.dac.hw.irq); + } +} + +static void TandyDACModeChanged(void) { + switch (tandy.dac.mode&3) { + case 0: + // joystick mode + break; + case 1: + break; + case 2: + // recording + break; + case 3: + // playback + tandy.dac.chan->FillUp(); + if (tandy.dac.frequency!=0) { + float freq=3579545.0f/((float)tandy.dac.frequency); + tandy.dac.chan->SetFreq((Bitu)freq); + float vol=((float)tandy.dac.amplitude)/7.0f; + tandy.dac.chan->SetVolume(vol,vol); + if ((tandy.dac.mode&0x0c)==0x0c) { + tandy.dac.dma.transfer_done=false; + tandy.dac.dma.chan=GetDMAChannel(tandy.dac.hw.dma); + if (tandy.dac.dma.chan) { + tandy.dac.dma.chan->Register_Callback(TandyDAC_DMA_CallBack); + tandy.dac.chan->Enable(true); +// LOG_MSG("Tandy DAC: playback started with freqency %f, volume %f",freq,vol); + } + } + } + break; + } +} + +static void TandyDACDMAEnabled(void) { + TandyDACModeChanged(); +} + +static void TandyDACDMADisabled(void) { +} + +static void TandyDACWrite(Bitu port,Bitu data,Bitu /*iolen*/) { + switch (port) { + case 0xc4: { + Bitu oldmode = tandy.dac.mode; + tandy.dac.mode = (Bit8u)(data&0xff); + if ((data&3)!=(oldmode&3)) { + TandyDACModeChanged(); + } + if (((data&0x0c)==0x0c) && ((oldmode&0x0c)!=0x0c)) { + TandyDACDMAEnabled(); + } else if (((data&0x0c)!=0x0c) && ((oldmode&0x0c)==0x0c)) { + TandyDACDMADisabled(); + } + } + break; + case 0xc5: + switch (tandy.dac.mode&3) { + case 0: + // joystick mode + break; + case 1: + tandy.dac.control = (Bit8u)(data&0xff); + break; + case 2: + break; + case 3: + // direct output + break; + } + break; + case 0xc6: + tandy.dac.frequency = tandy.dac.frequency & 0xf00 | (Bit8u)(data&0xff); + switch (tandy.dac.mode&3) { + case 0: + // joystick mode + break; + case 1: + case 2: + case 3: + TandyDACModeChanged(); + break; + } + break; + case 0xc7: + tandy.dac.frequency = tandy.dac.frequency & 0x00ff | (((Bit8u)(data&0xf))<<8); + tandy.dac.amplitude = (Bit8u)(data>>5); + switch (tandy.dac.mode&3) { + case 0: + // joystick mode + break; + case 1: + case 2: + case 3: + TandyDACModeChanged(); + break; + } + break; + } +} + +static Bitu TandyDACRead(Bitu port,Bitu /*iolen*/) { + switch (port) { + case 0xc4: + return (tandy.dac.mode&0x77) | (tandy.dac.irq_activated ? 0x08 : 0x00); + case 0xc6: + return (Bit8u)(tandy.dac.frequency&0xff); + case 0xc7: + return (Bit8u)(((tandy.dac.frequency>>8)&0xf) | (tandy.dac.amplitude<<5)); + } + LOG_MSG("Tandy DAC: Read from unknown %X",port); + return 0xff; +} + +static void TandyDACGenerateDMASound(Bitu length) { + if (length) { + Bitu read=tandy.dac.dma.chan->Read(length,tandy.dac.dma.buf); + tandy.dac.chan->AddSamples_m8(read,tandy.dac.dma.buf); + if (read < length) { + if (read>0) tandy.dac.dma.last_sample=tandy.dac.dma.buf[read-1]; + for (Bitu ct=read; ct < length; ct++) { + tandy.dac.chan->AddSamples_m8(1,&tandy.dac.dma.last_sample); + } + } + } +} + +static void TandyDACUpdate(Bitu length) { + if (tandy.dac.enabled && ((tandy.dac.mode&0x0c)==0x0c)) { + if (!tandy.dac.dma.transfer_done) { + Bitu len = length; + TandyDACGenerateDMASound(len); + } else { + for (Bitu ct=0; ct < length; ct++) { + tandy.dac.chan->AddSamples_m8(1,&tandy.dac.dma.last_sample); + } + } + } else { + tandy.dac.chan->AddSilence(); + } +} + + class TANDYSOUND: public Module_base { private: - IO_WriteHandleObject WriteHandler[3]; + IO_WriteHandleObject WriteHandler[4]; + IO_ReadHandleObject ReadHandler[4]; MixerObject MixerChan; + MixerObject MixerChanDAC; public: TANDYSOUND(Section* configuration):Module_base(configuration){ Section_prop * section=static_cast(configuration); + bool enable_hw_tandy_dac=true; + Bitu sbport, sbirq, sbdma; + if (SB_Get_Address(sbport, sbirq, sbdma)) { + enable_hw_tandy_dac=false; + } + real_writeb(0x40,0xd4,0x00); if (IS_TANDY_ARCH) { /* enable tandy sound if tandy=true/auto */ @@ -330,18 +506,47 @@ public: /* ports from second DMA controller conflict with tandy ports */ CloseSecondDMAController(); - WriteHandler[2].Install(0x1e0,SN76496Write,IO_MB,2); + if (enable_hw_tandy_dac) { + WriteHandler[2].Install(0x1e0,SN76496Write,IO_MB,2); + WriteHandler[3].Install(0x1e4,TandyDACWrite,IO_MB,4); +// ReadHandler[3].Install(0x1e4,TandyDACRead,IO_MB,4); + } } - - WriteHandler[0].Install(0xc0,SN76496Write,IO_MB,2); - WriteHandler[1].Install(0xc4,TandyDACWrite,IO_MB,4); - - + + Bit32u sample_rate = section->Get_int("tandyrate"); tandy.chan=MixerChan.Install(&SN76496Update,sample_rate,"TANDY"); - + + WriteHandler[0].Install(0xc0,SN76496Write,IO_MB,2); + + if (enable_hw_tandy_dac) { + // enable low-level Tandy DAC emulation + WriteHandler[1].Install(0xc4,TandyDACWrite,IO_MB,4); + ReadHandler[1].Install(0xc4,TandyDACRead,IO_MB,4); + + tandy.dac.enabled=true; + tandy.dac.chan=MixerChanDAC.Install(&TandyDACUpdate,sample_rate,"TANDYDAC"); + + tandy.dac.hw.base=0xc4; + tandy.dac.hw.irq =7; + tandy.dac.hw.dma =1; + } else { + tandy.dac.enabled=false; + tandy.dac.hw.base=0; + tandy.dac.hw.irq =0; + tandy.dac.hw.dma =0; + } + + tandy.dac.control=0; + tandy.dac.mode =0; + tandy.dac.irq_activated=false; + tandy.dac.frequency=0; + tandy.dac.amplitude=0; + tandy.dac.dma.last_sample=0; + + tandy.enabled=false; - real_writeb(0x40,0xd4,0xff); /* tandy DAC initialization value */ + real_writeb(0x40,0xd4,0xff); /* BIOS Tandy DAC initialization value */ Bitu i; struct SN76496 *R = &sn; @@ -371,7 +576,7 @@ public: static TANDYSOUND* test; -void TANDYSOUND_ShutDown(Section* sec) { +void TANDYSOUND_ShutDown(Section* /*sec*/) { delete test; } diff --git a/src/ints/bios.cpp b/src/ints/bios.cpp index 0b4d90a7..fb05be2b 100644 --- a/src/ints/bios.cpp +++ b/src/ints/bios.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: bios.cpp,v 1.76 2009-06-11 16:05:17 c2woody Exp $ */ +/* $Id: bios.cpp,v 1.77 2009-06-23 17:46:05 c2woody Exp $ */ #include "dosbox.h" #include "mem.h" @@ -70,6 +70,11 @@ static struct { Bit8u irq; Bit8u dma; } tandy_sb; +static struct { + Bit16u port; + Bit8u irq; + Bit8u dma; +} tandy_dac; static bool Tandy_InitializeSB() { /* see if soundblaster module available and at what port/IRQ/DMA */ @@ -86,14 +91,33 @@ static bool Tandy_InitializeSB() { } } +static bool Tandy_InitializeTS() { + /* see if Tandy DAC module available and at what port/IRQ/DMA */ + Bitu tsport, tsirq, tsdma; + if (TS_Get_Address(tsport, tsirq, tsdma)) { + tandy_dac.port=(Bit16u)(tsport&0xffff); + tandy_dac.irq =(Bit8u)(tsirq&0xff); + tandy_dac.dma =(Bit8u)(tsdma&0xff); + return true; + } else { + /* no Tandy DAC accessible */ + tandy_dac.port=0; + return false; + } +} + /* check if Tandy DAC is still playing */ static bool Tandy_TransferInProgress(void) { if (real_readw(0x40,0xd0)) return true; /* not yet done */ if (real_readb(0x40,0xd4)==0xff) return false; /* still in init-state */ + Bit8u tandy_dma = 1; + if (tandy_sb.port) tandy_dma = tandy_sb.dma; + else if (tandy_dac.port) tandy_dma = tandy_dac.dma; + IO_Write(0x0c,0x00); - Bit16u datalen=(Bit8u)(IO_ReadB(tandy_sb.dma*2+1)&0xff); - datalen|=(IO_ReadB(tandy_sb.dma*2+1)<<8); + Bit16u datalen=(Bit8u)(IO_ReadB(tandy_dma*2+1)&0xff); + datalen|=(IO_ReadB(tandy_dma*2+1)<<8); if (datalen==0xffff) return false; /* no DMA transfer */ else if ((datalen<0x10) && (real_readb(0x40,0xd4)==0x0f) && (real_readw(0x40,0xd2)==0x1c)) { /* stop already requested */ @@ -106,27 +130,44 @@ static void Tandy_SetupTransfer(PhysPt bufpt,bool isplayback) { Bitu length=real_readw(0x40,0xd0); if (length==0) return; /* nothing to do... */ - if (tandy_sb.port==0) return; + if ((tandy_sb.port==0) && (tandy_dac.port==0)) return; + + Bit8u tandy_irq = 7; + if (tandy_sb.port) tandy_irq = tandy_sb.irq; + else if (tandy_dac.port) tandy_irq = tandy_dac.irq; + Bit8u tandy_irq_vector = tandy_irq; + if (tandy_irq_vector<8) tandy_irq_vector += 8; + else tandy_irq_vector += (0x70-8); /* revector IRQ-handler if necessary */ - RealPt current_irq=RealGetVec(tandy_sb.irq+8); + RealPt current_irq=RealGetVec(tandy_irq_vector); if (current_irq!=tandy_DAC_callback[0]->Get_RealPointer()) { real_writed(0x40,0xd6,current_irq); - RealSetVec(tandy_sb.irq+8,tandy_DAC_callback[0]->Get_RealPointer()); + RealSetVec(tandy_irq_vector,tandy_DAC_callback[0]->Get_RealPointer()); } - IO_Write(tandy_sb.port+0xc,0xd0); /* stop DMA transfer */ - IO_Write(0x21,IO_Read(0x21)&(~(1<>16)&0xff); - IO_Write(tandy_sb.dma*2,(Bit8u)(bufpt&0xff)); - IO_Write(tandy_sb.dma*2,(Bit8u)((bufpt>>8)&0xff)); - switch (tandy_sb.dma) { + IO_Write(tandy_dma*2,(Bit8u)(bufpt&0xff)); + IO_Write(tandy_dma*2,(Bit8u)((bufpt>>8)&0xff)); + switch (tandy_dma) { case 0: IO_Write(0x87,bufpage); break; case 1: IO_Write(0x83,bufpage); break; case 2: IO_Write(0x81,bufpage); break; @@ -141,20 +182,31 @@ static void Tandy_SetupTransfer(PhysPt bufpt,bool isplayback) { tlength--; /* set transfer size */ - IO_Write(tandy_sb.dma*2+1,(Bit8u)(tlength&0xff)); - IO_Write(tandy_sb.dma*2+1,(Bit8u)((tlength>>8)&0xff)); - IO_Write(0x0a,tandy_sb.dma); /* enable DMA channel */ + IO_Write(tandy_dma*2+1,(Bit8u)(tlength&0xff)); + IO_Write(tandy_dma*2+1,(Bit8u)((tlength>>8)&0xff)); Bit16u delay=(Bit16u)(real_readw(0x40,0xd2)&0xfff); - /* set frequency */ - IO_Write(tandy_sb.port+0xc,0x40); - IO_Write(tandy_sb.port+0xc,256-delay*100/358); - /* set playback type to 8bit */ - if (isplayback) IO_Write(tandy_sb.port+0xc,0x14); - else IO_Write(tandy_sb.port+0xc,0x24); - /* set transfer size */ - IO_Write(tandy_sb.port+0xc,(Bit8u)(tlength&0xff)); - IO_Write(tandy_sb.port+0xc,(Bit8u)((tlength>>8)&0xff)); + Bit8u amplitude=(Bit8u)((real_readw(0x40,0xd2)>>13)&0x7); + if (tandy_sb.port) { + IO_Write(0x0a,tandy_dma); /* enable DMA channel */ + /* set frequency */ + IO_Write(tandy_sb.port+0xc,0x40); + IO_Write(tandy_sb.port+0xc,256-delay*100/358); + /* set playback type to 8bit */ + if (isplayback) IO_Write(tandy_sb.port+0xc,0x14); + else IO_Write(tandy_sb.port+0xc,0x24); + /* set transfer size */ + IO_Write(tandy_sb.port+0xc,(Bit8u)(tlength&0xff)); + IO_Write(tandy_sb.port+0xc,(Bit8u)((tlength>>8)&0xff)); + } else { + if (isplayback) IO_Write(tandy_dac.port,(IO_Read(tandy_dac.port)&0x7c) | 0x03); + else IO_Write(tandy_dac.port,(IO_Read(tandy_dac.port)&0x7c) | 0x02); + IO_Write(tandy_dac.port+2,(Bit8u)(delay&0xff)); + IO_Write(tandy_dac.port+3,(Bit8u)(((delay>>8)&0xf) | (amplitude<<5))); + if (isplayback) IO_Write(tandy_dac.port,(IO_Read(tandy_dac.port)&0x7c) | 0x1f); + else IO_Write(tandy_dac.port,(IO_Read(tandy_dac.port)&0x7c) | 0x1e); + IO_Write(0x0a,tandy_dma); /* enable DMA channel */ + } if (!isplayback) { /* mark transfer as recording operation */ @@ -163,10 +215,15 @@ static void Tandy_SetupTransfer(PhysPt bufpt,bool isplayback) { } static Bitu IRQ_TandyDAC(void) { + if (tandy_dac.port) { + IO_Read(tandy_dac.port); + } if (real_readw(0x40,0xd0)) { /* play/record next buffer */ /* acknowledge IRQ */ IO_Write(0x20,0x20); - IO_Read(tandy_sb.port+0xe); + if (tandy_sb.port) { + IO_Read(tandy_sb.port+0xe); + } /* buffer starts at the next page */ Bit8u npage=real_readb(0x40,0xd4)+1; @@ -182,11 +239,20 @@ static Bitu IRQ_TandyDAC(void) { Tandy_SetupTransfer(npage<<16,true); } } else { /* playing/recording is finished */ - RealSetVec(tandy_sb.irq+8,real_readd(0x40,0xd6)); + Bit8u tandy_irq = 7; + if (tandy_sb.port) tandy_irq = tandy_sb.irq; + else if (tandy_dac.port) tandy_irq = tandy_dac.irq; + Bit8u tandy_irq_vector = tandy_irq; + if (tandy_irq_vector<8) tandy_irq_vector += 8; + else tandy_irq_vector += (0x70-8); + + RealSetVec(tandy_irq_vector,real_readd(0x40,0xd6)); /* turn off speaker and acknowledge soundblaster IRQ */ - IO_Write(tandy_sb.port+0xc,0xd3); - IO_Read(tandy_sb.port+0xe); + if (tandy_sb.port) { + IO_Write(tandy_sb.port+0xc,0xd3); + IO_Read(tandy_sb.port+0xe); + } /* issue BIOS tandy sound device busy callout */ SegSet16(cs, RealSeg(tandy_DAC_callback[1]->Get_RealPointer())); @@ -196,10 +262,14 @@ static Bitu IRQ_TandyDAC(void) { } static void TandyDAC_Handler(Bit8u tfunction) { - if (!tandy_sb.port) return; + if ((!tandy_sb.port) && (!tandy_dac.port)) return; switch (tfunction) { case 0x81: /* Tandy sound system check */ - reg_ax=0xc4; + if (tandy_dac.port) { + reg_ax=tandy_dac.port; + } else { + reg_ax=0xc4; + } CALLBACK_SCF(Tandy_TransferInProgress()); break; case 0x82: /* Tandy sound system start recording */ @@ -228,6 +298,9 @@ static void TandyDAC_Handler(Bit8u tfunction) { CALLBACK_SCF(false); break; case 0x85: /* Tandy sound system reset */ + if (tandy_dac.port) { + IO_Write(tandy_dac.port,(Bit8u)(IO_Read(tandy_dac.port)&0xe0)); + } reg_ah=0x00; CALLBACK_SCF(false); break; @@ -864,9 +937,17 @@ public: for(Bitu i = 0; i < strlen(b_date); i++) phys_writeb(0xffff5+i,b_date[i]); phys_writeb(0xfffff,0x55); // signature + tandy_sb.port=0; + tandy_dac.port=0; if (use_tandyDAC) { /* tandy DAC sound requested, see if soundblaster device is available */ + Bitu tandy_dac_type = 0; if (Tandy_InitializeSB()) { + tandy_dac_type = 1; + } else if (Tandy_InitializeTS()) { + tandy_dac_type = 2; + } + if (tandy_dac_type) { real_writew(0x40,0xd0,0x0000); real_writew(0x40,0xd2,0x0000); real_writeb(0x40,0xd4,0xff); /* tandy DAC init value */ @@ -886,7 +967,14 @@ public: // pop ax // iret - RealPt current_irq=RealGetVec(tandy_sb.irq+8); + Bit8u tandy_irq = 7; + if (tandy_dac_type==1) tandy_irq = tandy_sb.irq; + else if (tandy_dac_type==2) tandy_irq = tandy_dac.irq; + Bit8u tandy_irq_vector = tandy_irq; + if (tandy_irq_vector<8) tandy_irq_vector += 8; + else tandy_irq_vector += (0x70-8); + + RealPt current_irq=RealGetVec(tandy_irq_vector); real_writed(0x40,0xd6,current_irq); for (Bit16u i=0; i<0x10; i++) phys_writeb(PhysMake(0xf000,0xa084+i),0x80); } else real_writeb(0x40,0xd4,0x00); @@ -995,7 +1083,14 @@ public: Bit32u orig_vector=real_readd(0x40,0xd6); if (orig_vector==tandy_DAC_callback[0]->Get_RealPointer()) { /* set IRQ vector to old value */ - RealSetVec(tandy_sb.irq+8,real_readd(0x40,0xd6)); + Bit8u tandy_irq = 7; + if (tandy_sb.port) tandy_irq = tandy_sb.irq; + else if (tandy_dac.port) tandy_irq = tandy_dac.irq; + Bit8u tandy_irq_vector = tandy_irq; + if (tandy_irq_vector<8) tandy_irq_vector += 8; + else tandy_irq_vector += (0x70-8); + + RealSetVec(tandy_irq_vector,real_readd(0x40,0xd6)); real_writed(0x40,0xd6,0x00000000); } delete tandy_DAC_callback[0];