src/main.c

changeset 57
feb84193a43a
parent 56
b3f309d46e97
child 62
c895256b528d
     1.1 diff -r b3f309d46e97 -r feb84193a43a src/main.c
     1.2 --- a/src/main.c	Mon Dec 13 03:00:43 2010 +0000
     1.3 +++ b/src/main.c	Tue Dec 14 02:41:40 2010 +0000
     1.4 @@ -243,18 +243,18 @@
     1.5  					d += wd2797_read_reg(&state.fdc_ctx, WD2797_REG_DATA);
     1.6  
     1.7  					// TODO: FIXME: if we get a pagefault, it NEEDS to be tagged as 'peripheral sourced'... this is a HACK!
     1.8 -					m68k_write_memory_16(state.dma_address << 1, d);
     1.9 +					m68k_write_memory_16(state.dma_address, d);
    1.10  				} else {
    1.11  					// Data write to FDC
    1.12  					// TODO: FIXME: if we get a pagefault, it NEEDS to be tagged as 'peripheral sourced'... this is a HACK!
    1.13 -					d = m68k_read_memory_16(state.dma_address << 1);
    1.14 +					d = m68k_read_memory_16(state.dma_address);
    1.15  
    1.16  					wd2797_write_reg(&state.fdc_ctx, WD2797_REG_DATA, (d >> 8));
    1.17  					wd2797_write_reg(&state.fdc_ctx, WD2797_REG_DATA, (d & 0xff));
    1.18  				}
    1.19  
    1.20  				// Increment DMA address
    1.21 -				state.dma_address++;
    1.22 +				state.dma_address+=2;
    1.23  				// Increment number of words transferred
    1.24  				num++; state.dma_count++;
    1.25  			}
    1.26 @@ -262,7 +262,7 @@
    1.27  			// Turn off DMA engine if we finished this cycle
    1.28  			if (state.dma_count >= 0x4000) {
    1.29  				printf("\tDMATRAN: transfer complete! dmaa=%06X, dmac=%04X\n", state.dma_address, state.dma_count);
    1.30 -				// apparently this isn't required...?
    1.31 +				// FIXME? apparently this isn't required...?
    1.32  //				state.dma_count = 0;
    1.33  				state.dmaen = false;
    1.34  			}