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

Function DSKDATR

src/disk.cpp:3947–3974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3945}
3946
3947uae_u16 DSKDATR(int slot)
3948{
3949 int i;
3950 uae_u16 v = 0;
3951
3952 for (i = 2; i >= 0; i--) {
3953 if (fifo_inuse[i]) {
3954 fifo_inuse[i] = 0;
3955 v = fifo[i];
3956 break;
3957 }
3958 }
3959
3960#if DISK_DEBUG_X > 1
3961 write_log("datr %d %d\n", dsklength, floppy[0].mfmpos);
3962#endif
3963
3964 if (i < 0) {
3965 write_log(_T("DSKDATR: FIFO underflow!\n"));
3966 } else if (dskdmaen == DSKDMA_READ && dsklength == 0) {
3967 // len==0 and (all slots empty or last slot read and one slot in use)
3968 if (disk_fifostatus() < 0 || (slot == 2 && fifo_inuse[0] && !fifo_inuse[1] && !fifo_inuse[2])) {
3969 disk_dmafinished();
3970 }
3971 }
3972 disk_strobe = false;
3973 return v;
3974}
3975
3976static void do_disk_index (void)
3977{

Callers 3

disk_doupdate_writeFunction · 0.85
doreaddmaFunction · 0.85
dmal_emu_diskFunction · 0.85

Calls 3

disk_fifostatusFunction · 0.85
disk_dmafinishedFunction · 0.85
write_logFunction · 0.70

Tested by

no test coverage detected