diff options
author | 2021-03-29 22:25:45 +0200 | |
---|---|---|
committer | 2021-03-29 22:30:08 +0200 | |
commit | 6a2743a4920db3b606a69e512e9a15f827806815 (patch) | |
tree | 9a705dc716e2b9c56d56e830c23ec0ecd9b447b3 | |
parent | 438edcd151dae46de91c54a6e0c5ead8ed8f3800 (diff) |
floppy: Fix an annoyingly subtle write bug
-rw-r--r-- | src/devices/imagedev/floppy.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index 9fd39fae6e5..2d3fd334afb 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -1157,14 +1157,16 @@ void floppy_image_device::write_flux(const attotime &start, const attotime &end, buf.push_back(floppy_image::MG_N); } + uint32_t cur_mg; if((buf[index] & floppy_image::TIME_MASK) == start_pos) { if(index) - index--; + cur_mg = buf[index-1]; else - index = buf.size() - 1; - } + cur_mg = buf[buf.size() - 1]; + } else + cur_mg = buf[index]; - uint32_t cur_mg = buf[index] & floppy_image::MG_MASK; + cur_mg &= floppy_image::MG_MASK; if(cur_mg == floppy_image::MG_N || cur_mg == floppy_image::MG_D) cur_mg = floppy_image::MG_A; @@ -1293,7 +1295,6 @@ void floppy_image_device::write_zone(uint32_t *buf, int &cells, int &index, uint spos = epos; } } - } } |