-
Notifications
You must be signed in to change notification settings - Fork 1
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 support for AppleSingle files #2
base: master
Are you sure you want to change the base?
Conversation
ed75e27
to
3d5854e
Compare
This looks great. Since we are adding public interfaces I may want to think more about how to organize it in terms of modules, whatever we do gets baked in for as long as we are on v3.x. For testing I usually like to compare the disk images that a2kit creates with the same disk image created by some other software, can we do that here? It looks like the code ran, but a byte-for-byte comparison can sometimes reveal a difference nevertheless. |
It turns out merging this PR requires a major version increment, try However there is a way to get this capability merged in short order using the If this makes sense, can you update the fork such that
One thing my research has not turned up is whether this CC65 way of packing the data and resource forks into a ProDOS 8 binary is universal, e.g., might some other software expect us to write them in reverse order? |
I'll add the tests and make the required changes. I'll un-draft the merge when it's ready for another review |
I'll revert the increment, not really sure why it snuck in there.
Yeah it'll be pretty trivial to check if the file is an AppleSingle based on the magic number. I'll make sure to add it.
I'd prefer if we keep the AppleSingle parsing in a seperate file so we can expand it in the future if needed. This would also make maintaining it a bit easier. We can create a new directory containing file parsers. If you still prefer placing it in
From what I've gathered resource forks are rarely used and documentation on them is pretty sparse. I'll have a look if I can find some more info about them. |
I agree the main parsing should be in a separate file in the long run, I just wanted to keep it private for now. If you can arrange to put it in a private module that would also do. My thinking is to put it eventually as a public root module in |
I compiled something with CC65 and used the fork to copy the binary to a disk using First about the actual workings from an end-user perspective. Right now if you put an AppleSingle to an MS-DOS disk it will copy data over, but will ignore the MS-DOS attributes silently. For ProDOS we are also not copying over all the "ProDOS File Info." In the general case we should retain that information. Luckily it is all representable in Next how to organize. We are allowed to add a "defaulted trait item." So what can be done is to add the following to fn pack_apple_single(&self, fimg: &mut FileImage, dat: &[u8]) -> STDRESULT {
Err(Box::new(FileSystemMismatch))
} You have to also add a dispatch function to pub fn pack_apple_single(&mut self, dat: &[u8]) -> STDRESULT {
self.packer().pack_apple_single(self, dat)
} This funny thing calls the appropriate Packer delegate per file system (the effect is like inheritance). The implementation can then be done per file system, at whatever pace we like, by adding this trait implementation in the appropriate N.b. the The new module, currently bios::as, can go as fs::as. I think it will have to be public to be visible from the various Finally in if let Ok(()) = fimg.pack_apple_single(&dat) {
Ok(())
} else if some_other_condition() {
// pack some other thing
} // etc |
Adding support for the different filesystems in that way sounds like a good idea. We can also make an unpack per filesystem which would make sharing individual files from a filesystem easier. Filesystems like CP/M etc can still be supported but showing a warning when no file attributes for the target fs could be found/applied. I think this would allow users to still write files if they want to. Currently I haven't been able to put a lot of time into the MR because I managed to fry my Apple2 and kill ~70% of the chips. So most of my free time has been going into testing everything and finding replacement parts. |
Oh dear sorry to hear that! |
CC65 outputs AppleSingle files which are currently not supported by a2kit. This merge adds the option to put AppleSingle formatted files onto disks.
Example: