File:  [RetroPC.NET] / np2 / i386c / Attic / dmap.c
Revision 1.4: download - view: text, annotated - select for diffs
Sun Mar 7 10:23:14 2004 JST (21 years, 7 months ago) by yui
Branches: MAIN
CVS tags: VER_0_75, HEAD
fix i386c stack pointer (T.Yui)

#include	"compiler.h"
#include	"cpucore.h"
#include	"pccore.h"
#include	"iocore.h"
#include	"dmap.h"


void dmap(void) {

	DMACH	ch;
	REG8	bit;
	UINT32	addr;

	if (dmac.working) {
		ch = dmac.dmach;
		bit = 1;
		do {
			if (dmac.working & bit) {
				// DMA working !
				if (!ch->leng.w) {
					dmac.stat |= bit;
					dmac.working &= ~bit;
					ch->proc.extproc(DMAEXT_END);
				}
				ch->leng.w--;
				addr = ch->adrs.d;
				if (necio.port0439 & 4) {
					addr = ch->adrs.d & 0xffffff;
				}
				ch->adrs.d += ((ch->mode & 0x20)?-1:1);
//				ch->adrs.w[DMA16_LOW] += ((ch->mode & 0x20)?-1:1);
				switch(ch->mode & 0x0c) {
					case 0x00:		// verifty
						ch->proc.inproc();
						break;

					case 0x04:		// port->mem
						i286_memorywrite(addr, ch->proc.inproc());
						break;

					default:
						ch->proc.outproc(i286_memoryread(addr));
						break;
				}
			}
			ch++;
			bit <<= 1;
		} while(bit & 0x0f);
	}
}


RetroPC.NET-CVS <cvs@retropc.net>