MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / doreaddma

Function doreaddma

src/disk.cpp:4275–4305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4273}
4274
4275static int doreaddma(void)
4276{
4277 if (dmaen(DMA_DISK) && bitoffset == 15 && dma_enable && dskdmaen == DSKDMA_READ && dsklength >= 0) {
4278 if (dsklength > 0) {
4279 // fast disk modes, just flush the fifo
4280 if (currprefs.floppy_speed > 100 && fifo_inuse[0] && fifo_inuse[1] && fifo_inuse[2]) {
4281 while (fifo_inuse[0]) {
4282 uae_u16 w = DSKDATR(0);
4283 chipmem_wput_indirect (dskpt, w);
4284 dskpt += 2;
4285 }
4286 }
4287 if (disk_fifostatus() > 0) {
4288 return -1;
4289 } else {
4290 dsklength--;
4291 // Paula bug: when dsklength reaches zero, FIFO status is checked too early.
4292 if (disk_fifostatus() < 0 && dsklength == 0) {
4293 disk_dmafinished();
4294 } else {
4295 DSKDAT(word);
4296#if DISK_DEBUG_X > 1
4297 write_log("buffer load %d %d\n", floppy[0].mfmpos, dsklength);
4298#endif
4299 }
4300 }
4301 }
4302 return 1;
4303 }
4304 return 0;
4305}
4306
4307static void wordsync_detected(bool startup)
4308{

Callers 3

disk_doupdate_readFunction · 0.85

Calls 6

dmaenFunction · 0.85
DSKDATRFunction · 0.85
disk_fifostatusFunction · 0.85
disk_dmafinishedFunction · 0.85
DSKDATFunction · 0.85
write_logFunction · 0.70

Tested by

no test coverage detected