summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/imagedev
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2018-05-23 07:04:22 +0200
committer Olivier Galibert <galibert@pobox.com>2018-05-26 22:06:40 +0200
commitde919271fef7b0378e7d3a4baa800bc8d3952244 (patch)
treebc1163e80691a2ea42c5541899197fa642251927 /src/devices/imagedev
parent5291d140218339dff4fa471b1f8f1cfab3eb3fa1 (diff)
Floppy robustification, better bitstream handling [John Keoni Morris, Peter Ferrie, Olivier Galibert]
Diffstat (limited to 'src/devices/imagedev')
-rw-r--r--src/devices/imagedev/floppy.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp
index 5ef5668b741..a18308b5f36 100644
--- a/src/devices/imagedev/floppy.cpp
+++ b/src/devices/imagedev/floppy.cpp
@@ -771,9 +771,10 @@ attotime floppy_image_device::get_next_index_time(std::vector<uint32_t> &buf, in
{
uint32_t next_position;
int cells = buf.size();
- if(index+delta < cells)
+ if(index+delta < cells) {
next_position = buf[index+delta] & floppy_image::TIME_MASK;
- else {
+
+ } else {
if((buf[cells-1]^buf[0]) & floppy_image::MG_MASK)
delta--;
index = index + delta - cells + 1;
@@ -788,14 +789,6 @@ attotime floppy_image_device::get_next_transition(const attotime &from_when)
if(!image || mon)
return attotime::never;
- // If the drive is still spinning up, pretend that no transitions will come
- // TODO: Implement a proper spin-up ramp for transition times, also in order
- // to cover potential copy protection measures that have direct device
- // access (mz)
- // MORE TODO: this breaks the tandy2k and pcjr. needs investigation.
- //if (ready_counter > 0)
- // return attotime::never;
-
std::vector<uint32_t> &buf = image->get_buffer(cyl, ss, subcyl);
uint32_t cells = buf.size();
if(cells <= 1)
@@ -809,10 +802,11 @@ attotime floppy_image_device::get_next_transition(const attotime &from_when)
if(index == -1)
return attotime::never;
- attotime result = get_next_index_time(buf, index, 1, base);
- if(result > from_when)
- return result;
- return get_next_index_time(buf, index, 2, base);
+ for(unsigned int i=1;; i++) {
+ attotime result = get_next_index_time(buf, index, i, base);
+ if(result > from_when)
+ return result;
+ }
}
void floppy_image_device::write_flux(const attotime &start, const attotime &end, int transition_count, const attotime *transitions)