1
0
Fork 0

add possibility to close dma controllers;

remove second dma controller when tandy sound is enabled and machine=vga


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2377
This commit is contained in:
Sebastian Strohhäcker 2005-11-16 20:27:40 +00:00
parent 07be3858f1
commit f22e8d5041
6 changed files with 207 additions and 142 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dma.h,v 1.14 2005-03-24 10:18:45 qbix79 Exp $ */
/* $Id: dma.h,v 1.15 2005-11-16 20:27:39 c2woody Exp $ */
#ifndef DOSBOX_DMA_H
#define DOSBOX_DMA_H
@ -31,19 +31,6 @@ enum DMAEvent {
class DmaChannel;
typedef void (* DMA_CallBack)(DmaChannel * chan,DMAEvent event);
class DmaController {
public:
bool flipflop;
Bit8u ctrlnum;
Bit8u chanbase;
public:
DmaController(Bit8u num) {
flipflop = false;
ctrlnum = num;
chanbase = num * 4;
}
};
class DmaChannel {
public:
Bit32u pagebase;
@ -85,7 +72,37 @@ public:
Bitu Write(Bitu size, Bit8u * buffer);
};
extern DmaChannel *DmaChannels[8];
extern DmaController *DmaControllers[2];
class DmaController {
private:
Bit8u ctrlnum;
bool flipflop;
DmaChannel *DmaChannels[4];
public:
IO_ReadHandleObject DMA_ReadHandler[0x11];
IO_WriteHandleObject DMA_WriteHandler[0x11];
DmaController(Bit8u num) {
flipflop = false;
ctrlnum = num; /* first or second DMA controller */
for(Bit8u i=0;i<4;i++) {
DmaChannels[i] = new DmaChannel(i+ctrlnum*4,ctrlnum==1);
}
}
~DmaController(void) {
for(Bit8u i=0;i<4;i++) {
delete DmaChannels[i];
}
}
DmaChannel * GetChannel(Bit8u chan) {
if (chan<4) return DmaChannels[chan];
else return NULL;
}
void WriteControllerReg(Bitu reg,Bitu val,Bitu len);
Bitu ReadControllerReg(Bitu reg,Bitu len);
};
DmaChannel * GetDMAChannel(Bit8u chan);
void CloseSecondDMAController(void);
bool SecondDMAControllerAvailable(void);
#endif