X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=libs%2Foldmik%2Fsrc%2Fmdma.h;fp=libs%2Foldmik%2Fsrc%2Fmdma.h;h=893d359f377a1a6325526ebb626bf515cd439315;hp=0000000000000000000000000000000000000000;hb=77db1ca18d5446dcda9e524261399b63c2cd1813;hpb=a714b8c4811627d874934b0a0387b8cb27fc5921 diff --git a/libs/oldmik/src/mdma.h b/libs/oldmik/src/mdma.h new file mode 100644 index 0000000..893d359 --- /dev/null +++ b/libs/oldmik/src/mdma.h @@ -0,0 +1,42 @@ +#ifndef MDMA_H +#define MDMA_H + +#include "mtypes.h" + +#define READ_DMA 0 +#define WRITE_DMA 1 +#define INDEF_READ 2 +#define INDEF_WRITE 3 + +#ifdef __WATCOMC__ + +typedef struct{ + void *continuous; /* the pointer to a page-continous dma buffer */ + UWORD raw_selector; /* the raw allocated dma selector */ +} DMAMEM; + +#elif defined(__DJGPP__) + +typedef struct{ + void *continuous; /* the pointer to a page-continous dma buffer */ + _go32_dpmi_seginfo raw; /* points to the memory that was allocated */ +} DMAMEM; + +#else + +typedef struct{ + void *continuous; /* the pointer to a page-continous dma buffer */ + void *raw; /* points to the memory that was allocated */ +} DMAMEM; + +#endif + +DMAMEM *MDma_AllocMem(UWORD size); +void MDma_FreeMem(DMAMEM *dm); +int MDma_Start(int channel,DMAMEM *dm,UWORD size,int type); +void MDma_Stop(int channel); +void *MDma_GetPtr(DMAMEM *dm); +void MDma_Commit(DMAMEM *dm,UWORD index,UWORD count); +UWORD MDma_Todo(int channel); + +#endif