summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2022-08-11 18:57:50 +0200
committer Olivier Galibert <galibert@pobox.com>2022-08-11 18:57:55 +0200
commit961a2aa8e43559c25f440deb49856ccc88f1cfb2 (patch)
tree4ac3710f2962a959c9b95342d61e47e9449ddc64 /src/lib/formats
parentc2ce67c37df82bc28622a929d23956f7cbdcf162 (diff)
woz/flux: even more fixes after some clarifications
Diffstat (limited to 'src/lib/formats')
-rw-r--r--src/lib/formats/ap2_dsk.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/lib/formats/ap2_dsk.cpp b/src/lib/formats/ap2_dsk.cpp
index 7fb3a2225dd..54b542095f4 100644
--- a/src/lib/formats/ap2_dsk.cpp
+++ b/src/lib/formats/ap2_dsk.cpp
@@ -1743,25 +1743,21 @@ bool a2_woz_format::load(util::random_read &io, uint32_t form_factor, const std:
uint32_t boff = (uint32_t)r16(img, trks_off + 0) * 512;
uint32_t track_size = r32(img, trks_off + 4);
- // Ticks are 125ns, e.g. 8000000 ticks per second
- static const int ticks_per_speed_zone[5] = {
- 60 * 8000000 / 394,
- 60 * 8000000 / 429,
- 60 * 8000000 / 472,
- 60 * 8000000 / 525,
- 60 * 8000000 / 590
- };
-
- uint32_t total_ticks = is_35 ? ticks_per_speed_zone[trkid / (2*16)] : 60 * 8000000 / 300;
+ uint32_t total_ticks = 0;
+ for(uint32_t i=0; i != track_size; i++)
+ total_ticks += img[boff+i];
+ // Assume there is always a pulse at index, and it's
+ // the last one in the stream
std::vector<uint32_t> &buf = image->get_buffer(track, head, subtrack);
+ buf.push_back(floppy_image::MG_F | 0);
uint32_t cpos = 0;
for(uint32_t i=0; i != track_size; i++) {
uint8_t step = img[boff+i];
cpos += step;
- if(step != 0xff)
+ if(step != 0xff && i != track_size-1)
buf.push_back(floppy_image::MG_F | uint64_t(cpos)*200000000/total_ticks);
- }
+ }
} else if(idx != 0xff) {
uint32_t trks_off = off_trks + (idx * 8);