src/main.c

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