|
|
| version 1.9, 2004/03/06 18:25:36 | version 1.10, 2004/03/29 14:19:25 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "cpucore.h" | |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "sound.h" | #include "sound.h" |
| Line 52 void dmac_check(void) { | Line 53 void dmac_check(void) { |
| if (!(dmac.work & bit)) { | if (!(dmac.work & bit)) { |
| dmac.work |= bit; | dmac.work |= bit; |
| if (ch->proc.extproc(DMAEXT_START)) { | if (ch->proc.extproc(DMAEXT_START)) { |
| dmac.stat &= ~bit; // ver0.27 | dmac.stat &= ~bit; |
| dmac.working |= bit; | dmac.working |= bit; |
| workchg = TRUE; | workchg = TRUE; |
| } | } |
| Line 74 void dmac_check(void) { | Line 75 void dmac_check(void) { |
| } | } |
| } | } |
| UINT dmac_getdatas(DMACH dmach, BYTE *buf, UINT size) { | |
| UINT leng; | |
| UINT32 addr; | |
| UINT i; | |
| leng = min(dmach->leng.w, size); | |
| if (leng) { | |
| addr = dmach->adrs.d; // + mask | |
| if (!(dmach->mode & 0x20)) { // dir + | |
| for (i=0; i<leng; i++) { | |
| buf[i] = MEMP_READ8(addr + i); | |
| } | |
| dmach->adrs.d += leng; | |
| } | |
| else { // dir - | |
| for (i=0; i<leng; i++) { | |
| buf[i] = MEMP_READ8(addr - i); | |
| } | |
| dmach->adrs.d -= leng; | |
| } | |
| dmach->leng.w -= leng; | |
| if (dmach->leng.w == 0) { | |
| dmach->proc.extproc(DMAEXT_END); | |
| } | |
| } | |
| return(leng); | |
| } | |
| // ---- I/O | // ---- I/O |