src/mame/machine/snes.c
| r5439 | r5440 | |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | static TIMER_CALLBACK( snes_reset_hdma ) |
| 119 | { |
| 120 | snes_hdma_init(); |
| 121 | } |
| 122 | |
| 118 | 123 | static TIMER_CALLBACK( snes_scanline_tick ) |
| 119 | 124 | { |
| 120 | 125 | /* Increase current line - we want to latch on this line during it, not after it */ |
| r5439 | r5440 | |
| 161 | 166 | timer_adjust_oneshot(snes_hirq_timer, video_screen_get_time_until_pos(machine->primary_screen, snes_ppu.beam.current_vert, pixel*snes_htmult), 0); |
| 162 | 167 | } |
| 163 | 168 | } |
| 164 | | } |
| 169 | } |
| 165 | 170 | |
| 166 | 171 | /* Start of VBlank */ |
| 167 | 172 | if( snes_ppu.beam.current_vert == snes_ppu.beam.last_visible_line ) |
| r5439 | r5440 | |
| 1230 | 1235 | data = 0; /* Once DMA is done we need to reset all bits to 0 */ |
| 1231 | 1236 | break; |
| 1232 | 1237 | 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); |
| 1233 | 1240 | break; |
| 1234 | 1241 | case MEMSEL: /* Access cycle designation in memory (2) area */ |
| 1235 | 1242 | /* FIXME: Need to adjust the speed only during access of banks 0x80+ |
| r5439 | r5440 | |
| 2174 | 2181 | if( !length ) |
| 2175 | 2182 | length = 0x10000; /* 0x0000 really means 0x10000 */ |
| 2176 | 2183 | |
| 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 | |
| 2177 | 2186 | #ifdef SNES_DBG_GDMA |
| 2178 | 2187 | 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 ); |
| 2179 | 2188 | #endif |