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
Add FDOS disk format for the SWTPC 6800 #10273
Conversation
The FDOS Operating System was released by SWTPC in 1977 along with the MF-68 Mini Disk System and was superceeded by FLEX a few months later. This change adds support to boot FDOS on the SWTPC 6800 machine in MAME using a specific disk image (FDOSMPS.DSK) from deramp.com (Mike Douglas) and can also read/write the other available disk images.
src/lib/formats/fdos_dsk.cpp
Outdated
char filename[8]{}; | ||
char password[8]{}; | ||
uint8_t start_track = 0; | ||
uint8_t start_sector = 0; | ||
uint8_t num_sectors[2] = {}; | ||
uint8_t file_type = 0; | ||
uint8_t start_addr[2] = {}; | ||
uint8_t end_addr[2] = {}; | ||
uint8_t exec_addr[2] = {}; | ||
uint8_t basic_high_line[2] = {}; | ||
uint8_t spares[3] = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you mixing T foo[N]{};
and T foo[N] = {};
style for array initialisation (with and without the equals sign) here? Please pick a single style to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch here, your fix was what I actually intended.
src/lib/formats/fdos_dsk.cpp
Outdated
LOG_FORMATS("FDOS floppy dsk: size %d bytes, %d total sectors, %d remaining bytes, expected form factor %x\n", | ||
(uint32_t)size, | ||
(uint32_t)size / f.sector_base_size, | ||
(uint32_t)size % f.sector_base_size, | ||
form_factor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn’t need to to cast the integers down to print them – osd_printf_info
and friends are type-safe and handle 64-bit integers fine.
Since dumbass github doesn't allow me to reply by mail, let's do it again here: Why so complex? It seems to be a fixed-size, pure sector format you handle nicely by deriving wd177x_format, but then you do a ton of checking of the actual sector contents. Why is it needed, isn't the size sufficient? |
Size by itself is not sufficient to distinguish this format from FLEX 2.0 (flex_dsk.cpp) format of the same size but different sector order. If you really do not like the complexity of this format then one option would be to add a generic catch all that would need to be last in the list of format detection as an attempt to guard against false positives. There are pros and cons for both the more specific and generic approaches. Please let me know if you want me to prepare a draft to explore this option. |
Ok, we had a similar issue with the apple2 with the do (dos) and po (prodos) formats which are also pure sector (hence same size) with a different sector order. To handle that we have two things:
You may be able to do something similar? Apple 2 code is in ap2_dsk.cpp for reference, a2_16sect_format::identify essentially. The heuristic would be what you already implemented in identify, and the approach would leave the freedom to the user to force one way or the other when needed. |
Why so complex? It seems to be a fixed-size, pure sector format you handle
nicely by deriving wd177x_format, but then you do a ton of checking of the
actual sector contents. Why is it needed, isn't the size sufficient?
OG.
…On Fri, Aug 26, 2022 at 3:44 AM Michael R. Furman ***@***.***> wrote:
The FDOS Operating System was released by SWTPC in 1977 along with the
MF-68 Mini Disk System and was superceeded by FLEX a few months later.
This change adds support to boot FDOS on the SWTPC 6800 machine in MAME
using a specific disk image (FDOSMPS.DSK) from deramp.com (Mike Douglas)
and can also read/write the other available disk images.
------------------------------
You can view, comment on, or merge this pull request online at:
#10273
Commit Summary
- d93d41a
<d93d41a>
Add FDOS disk format for the SWTPC 6800
File Changes
(5 files <https://github.com/mamedev/mame/pull/10273/files>)
- *M* scripts/src/formats.lua
<https://github.com/mamedev/mame/pull/10273/files#diff-40acc50be6e02a7e5502e9e1524dc0674a4b811a76c12cc9f424c08a69f5213f>
(12)
- *M* src/devices/bus/ss50/dc5.cpp
<https://github.com/mamedev/mame/pull/10273/files#diff-449ff7e1ba19772d0eb7231f781d259c47fd96a0062307304acbf277d8d1f3d8>
(2)
- *M* src/lib/formats/all.cpp
<https://github.com/mamedev/mame/pull/10273/files#diff-64f70876a68ca40ef7588069f6483b73fbbe5c75e66fb74f4345accc2e386459>
(4)
- *A* src/lib/formats/fdos_dsk.cpp
<https://github.com/mamedev/mame/pull/10273/files#diff-0231ef23e60a786d88480dca92512a7f5cf5dc3321acfe3f404b2c1aa51f6577>
(185)
- *A* src/lib/formats/fdos_dsk.h
<https://github.com/mamedev/mame/pull/10273/files#diff-263f304b4bf77fe9620b1c73a7f73545a3fa118f7c414008438b8fc7ba101be0>
(30)
Patch Links:
- https://github.com/mamedev/mame/pull/10273.patch
- https://github.com/mamedev/mame/pull/10273.diff
—
Reply to this email directly, view it on GitHub
<#10273>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGSF4KWBNLYQ35YCW6UB4TV3AOQFANCNFSM57VCCMZQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
The FDOS Operating System was released by SWTPC in 1977 along with the
MF-68 Mini Disk System and was superceeded by FLEX a few months later.
This change adds support to boot FDOS on the SWTPC 6800 machine in MAME
using a specific disk image (FDOSMPS.DSK) from deramp.com (Mike Douglas)
and can also read/write the other available disk images.