Previous 15994 Revisions Next

r7744 Tuesday 6th April, 2010 at 23:31:37 UTC by Angelo Salese
[SNES]: Basic implementation of the DMA master cycles steals
[src/mame/machine]snes.c

src/mame/machine/snes.c
r7743r7744
17791779{
17801780   snes_state *state = (snes_state *)space->machine->driver_data;
17811781
1782   /* every byte transfer takes 8 master cycles */
1783   cpu_adjust_icount(space->cpu,-8);
1784
17821785   if (state->dma_channel[dma].dmap & 0x80)   /* PPU->CPU */
17831786   {
17841787      if (bbus == 0x2180 && ((abus & 0xfe0000) == 0x7e0000 || (abus & 0x40e000) == 0x0000))
r7743r7744
19801983   UINT16 bbus;
19811984   UINT32 abus, abus_bank, length;
19821985
1986   /* FIXME: we also need to round to the nearest 8 master cycles */
1987
1988   /* overhead steals 8 master cycles, correct? */
1989   cpu_adjust_icount(space->cpu,-8);
1990
19831991   /* Assume priority of the 8 DMA channels is 0-7 */
19841992   for (i = 0; i < 8; i++)
19851993   {
r7743r7744
20902098         /* We're done, so write the new abus back to the registers */
20912099         state->dma_channel[i].src_addr = abus;
20922100         state->dma_channel[i].trans_size = 0;
2101         /* active channel takes 8 master cycles */
2102         cpu_adjust_icount(space->cpu,-8);
20932103      }
20942104   }
2105
2106   /* finally, take yet another 8 master cycles for the aforementioned overhead */
2107   cpu_adjust_icount(space->cpu,-8);
20952108}
20962109
20972110READ8_HANDLER( superfx_r_bank1 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team