Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b-em can't read SSD file (which works in other emulators) #63

Closed
davidgiven opened this issue May 31, 2018 · 7 comments
Closed

b-em can't read SSD file (which works in other emulators) #63

davidgiven opened this issue May 31, 2018 · 7 comments

Comments

@davidgiven
Copy link

Attached in an ssd generated from beebasm; it works fine in MAME and jsbeeb, but half the files show up as corrupt in b-em.

To reproduce, load into a BBC Master 128 with DFS and autoboot. It'll crash on startup because setscrn is corrupt. Try it on jsbeeb and setscrn will contain real machine code.

I originally thought this was a beebasm bug (stardot/beebasm#32) until I realised that the disk catalogue between the known-good image and the known-bad image was identical. Somehow b-em is just reading half the files from the wrong place on the disk.

I've checked that I'm up-to-date with the head of master.

mandel.zip

@davidgiven
Copy link
Author

What's happening is that try_dfs is miscategorising the disk as a SIDES_INTERLEAVED DFS disk, rather than a SIDES_SINGLE one. That's because the heuristic to try and check for an interleaved disk is being spoofed by a completely coincidental piece of data at offset &106 of track 1 which looks like another catalogue header, so it thinks it's a double-sided disk.

I have no idea what can be done about this.

@SteveFosdick
Copy link
Collaborator

That's a pity. The only two options that come to mind are to see if there is a more throrough heuristic or to revert to using the file extension.

The reason for going for a heuristic was to deal with the "sequential-sided-disc" format which is also in the wild but uses the same file extension, SSD, as single-sided discs and to deal with the fact that filename extensions have not been assigned to images of discs from non-Acorn DFSes.

I'll check out the documention again.

@SteveFosdick
Copy link
Collaborator

Ok, I have come up with an extra couple of tests. In theory, nothing could make a co-incidence impossible but this should make it much less likely. As well as checking that the number of sectors seems to match the new code also checks that the number of directory entries is valid and that the start sector addresses are sorted in descending order. I just need to test it, now.

@SteveFosdick
Copy link
Collaborator

The new code correctly detects your mandel SSD. Now to test on some others.

@SteveFosdick
Copy link
Collaborator

Ok, I have a fix in branch https://github.com/stardot/b-em/tree/sf/issue63.

@SteveFosdick
Copy link
Collaborator

This commit is now in master.

@davidgiven
Copy link
Author

Thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants