Previous 15994 Revisions Next

r5440 Saturday 15th August, 2009 at 17:42:36 UTC by Angelo Salese
[SNES]: Fixed HDMA mid-frame inits.
[src/mame/machine]snes.c

src/mame/machine/snes.c
r5439r5440
115115   }
116116}
117117
118static TIMER_CALLBACK( snes_reset_hdma )
119{
120   snes_hdma_init();
121}
122
118123static TIMER_CALLBACK( snes_scanline_tick )
119124{
120125   /* Increase current line - we want to latch on this line during it, not after it */
r5439r5440
161166            timer_adjust_oneshot(snes_hirq_timer, video_screen_get_time_until_pos(machine->primary_screen, snes_ppu.beam.current_vert, pixel*snes_htmult), 0);
162167         }
163168      }
164       }
169      }
165170
166171   /* Start of VBlank */
167172   if( snes_ppu.beam.current_vert == snes_ppu.beam.last_visible_line )
r5439r5440
12301235         data = 0;   /* Once DMA is done we need to reset all bits to 0 */
12311236         break;
12321237      case HDMAEN:   /* HDMA channel designation */
1238         if(data) //if a HDMA is enabled, data is inited at the next scanline
1239            timer_set(space->machine, video_screen_get_time_until_pos(space->machine->primary_screen, snes_ppu.beam.current_vert+1, 0), NULL, 0, snes_reset_hdma);
12331240         break;
12341241      case MEMSEL:   /* Access cycle designation in memory (2) area */
12351242         /* FIXME: Need to adjust the speed only during access of banks 0x80+
r5439r5440
21742181         if( !length )
21752182            length = 0x10000;   /* 0x0000 really means 0x10000 */
21762183
2184//         printf( "GDMA-Ch %d: len: %X, abus: %X, bbus: %X, incr: %d, dir: %s, type: %d\n", i, length, abus, bbus, increment, snes_ram[SNES_DMA_BASE + dma] & 0x80 ? "PPU->CPU" : "CPU->PPU", snes_ram[SNES_DMA_BASE + dma] & 0x7 );
2185
21772186#ifdef SNES_DBG_GDMA
21782187         mame_printf_debug( "GDMA-Ch %d: len: %X, abus: %X, bbus: %X, incr: %d, dir: %s, type: %d\n", i, length, abus, bbus, increment, snes_ram[SNES_DMA_BASE + dma] & 0x80 ? "PPU->CPU" : "CPU->PPU", snes_ram[SNES_DMA_BASE + dma] & 0x7 );
21792188#endif

Previous 15994 Revisions Next


© 1998-2018 The MESS Team