diff options
author | 987123879113 <63495610+987123879113@users.noreply.github.com> | 2021-03-02 14:03:35 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-02 16:03:35 +1100 |
commit | eb2ea5d355f54fa741e4a7e4cc208a0dd46bb5a7 (patch) | |
tree | 82fb32e06517911dc0d7bf6983e1efaf27388056 /src/devices/machine/upd765.cpp | |
parent | 8c9c79217e7db72a733204ca5086e28911456bcd (diff) |
-machine/fdc37c665gt.cpp: Reimplemented with floppy and parallel support.
-mahine/upd765.cpp: Implemented sector-based termination conditions for read commands.
Diffstat (limited to 'src/devices/machine/upd765.cpp')
-rw-r--r-- | src/devices/machine/upd765.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/devices/machine/upd765.cpp b/src/devices/machine/upd765.cpp index f2eff71730e..1ad53ec9ae0 100644 --- a/src/devices/machine/upd765.cpp +++ b/src/devices/machine/upd765.cpp @@ -679,8 +679,8 @@ uint8_t upd765_family_device::fifo_pop(bool internal) memmove(fifo, fifo+1, fifo_pos); if(!fifo_write && !fifo_pos) disable_transfer(); - int thr = fifocfg & 15; - if(fifo_write && fifo_expected && (fifo_pos <= thr || (fifocfg & 0x20))) + int thr = fifocfg & FIF_THR; + if(fifo_write && fifo_expected && (fifo_pos <= thr || (fifocfg & FIF_DIS))) enable_transfer(); return r; } @@ -977,6 +977,13 @@ void upd765_family_device::live_run(attotime limit) return; } + if ( + ((command[0] & 0x08) == 0 && cur_live.data_reg == 0xf8) // Encountered deleted sector during read data + || ((command[0] & 0x08) != 0 && cur_live.data_reg == 0xfb) // Encountered normal sector during read deleted data + ) { + st2 |= ST2_CM; + } + cur_live.bit_counter = 0; cur_live.state = READ_SECTOR_DATA; break; @@ -1882,6 +1889,15 @@ void upd765_family_device::read_data_continue(floppy_info &fi) fi.sub_state = COMMAND_DONE; break; } + + if ((st2 & ST2_CM) && !(command[0] & 0x20)) { + // Encountered terminating sector while in non-skip mode. + // This will stop reading when a normal data sector is encountered during read deleted data, + // or when a deleted sector is encountered during a read data command. + fi.sub_state = COMMAND_DONE; + break; + } + bool done = tc_done; if(command[4] == command[6]) { if(command[0] & 0x80) { |