sean-gugler / u4remasteredA2

Ultima IV Remastered for the Apple II
57 stars 7 forks source link

Is it possible to apply all the fixes to the Ultima IV WOZ files ? #10

Closed wyatt-wong closed 2 years ago

sean-gugler commented 2 years ago

Can you send me a link to the woz files, please?

wyatt-wong commented 2 years ago

Can you send me a link to the woz files, please?

https://archive.org/details/wozaday_Ultima_IV

sean-gugler commented 2 years ago

Thank you for the link!

Please note, my project is not simply a patch that was applied to any existing disk image - it is a complete reconstruction of new disk images, meant as a replacement for the originals. The code is recompiled from assembly listings; there is nothing to "apply" to the woz files. Please download and enjoy the Remastered edition from my Releases page and use them the same way you would use the woz files.

I am happy to do the reverse, though, and adopt INTO my project any differences from disk images that I've not seen before. I have carefully examined the woz files you linked, but I found that their contents are identical to the UltimaIV4amCrack files, which are well known to me. This is not surprising since both were uploaded by the same person, alias "4am". The woz files are just a different format of disk image generated from the same physical floppy disk media that the crack was created from.

What IS interesting to me is the intact copy protection present on the woz images. I may take the time to study and document that code at a later date.

Cheers!

wyatt-wong commented 2 years ago

Thank you for the link!

Please note, my project is not simply a patch that was applied to any existing disk image - it is a complete reconstruction of new disk images, meant as a replacement for the originals. The code is recompiled from assembly listings; there is nothing to "apply" to the woz files. Please download and enjoy the Remastered edition from my Releases page and use them the same way you would use the woz files.

I am happy to do the reverse, though, and adopt INTO my project any differences from disk images that I've not seen before. I have carefully examined the woz files you linked, but I found that their contents are identical to the UltimaIV4amCrack files, which are well known to me. This is not surprising since both were uploaded by the same person, alias "4am". The woz files are just a different format of disk image generated from the same physical floppy disk media that the crack was created from.

What IS interesting to me is the intact copy protection present on the woz images. I may take the time to study and document that code at a later date.

Cheers!

Well, thanks for your explanation. But initially I thought that you just patched the cracked Ultima IV DSK version. However, for those who want to use the original Ultima IV in WOZ Format which include the original copy-protection, they are not able to enjoy the fixes and enhancements from your remastered Ultima IV.

I believed the copy protection of Ultima IV only applies to the Boot Disk but not apply to other 3 disks. However, I could be wrong about that. You are right that 4am (https://twitter.com/a2_4am) is responsible to generate the WOZ files from the original copy-protected Ultima IV disks as well as creating a cracked version of Ultima IV which removed the copy-protection, most probably using his well-known tool passport (https://github.com/a2-4am/passport).

I am no expert in WOZ file format nor copy-protection. If you want to explore how to apply the patch to the WOZ file, you may consult 4am (from his twitter account that I posted above) and John Keoni Morris (https://twitter.com/diskblitz) who is the genius to design the WOZ format and the hardware to capture the copy-protection information from the original Ultima IV floppy disks.

sean-gugler commented 2 years ago

You are correct, only the Program Disk (boot) is copy protected. The other 3 are standard Apple DOS 3.3 format.

The only value in preserving the copy protection, in my opinion, is as an authentic historical record for study. The existing WOZ release from 4am already achieves this goal: it faithfully represents the disk data exactly as it was in 1985. Modifying such a disk image with fixes inherently invalidates its historical authenticity; the resulting file is properly characterized as an "enhancement" not as a "preservation".

So is there any other advantage to having an "enhanced" edition that also retains the copy protection? I cannot think of one. In fact, I can think of a definite disadvantage: it would be much harder for someone to transfer such a disk image file onto physical disk media that would run properly on a real Apple II machine. It could only be played on an emulator. Eliminating the protection is one of the enhancements offered by the Remaster: to more easily enjoy it on real hardware.

You speak again of "how to apply the patch to the WOZ file" but this is not an accurate description of my project. The phrase "applying a patch" suggests replacing some small-ish amount of binary data with alternate data, without disrupting the data around it. While my Remaster project does this for some game files, it also completely replaces other entire game files. Some of the replacements are larger than the originals! This involves allocating additional sectors in the sector map and adjusting the disk's master table of contents. My Makefile actually constructs an entire disk image from scratch, populated with my rebuilt files, because that is easier than attempting to "patch" them into any existing disk image. See the branch diff for comprehesive details of all the changes I've introduced.


As a side note, WOZ isn't even the most detailed format that exists today. These are the most common file formats for representing Apple 5.25" disks, in decreasing order of size (my apologies if you already know this or aren't interested; perhaps other readers following this thread may find it useful though):

  1. .a2r - measures the variable strength of magnetic flux on the disk media, at a higher resolution than the Apple II disk drive can access
  2. .woz - binary 0/1 bitstream that the Disk II controller would produce by interpreting those variable flux levels at a specific clock interval
  3. .nib - stream of 8-bit "nibbles" that DOS subroutines would produce upon encountering the above bitstream, skipping runs of '0' bits - it includes sector headers, checksums, and other values "invisible" to a typical Apple program that's just trying to read files
  4. .dsk - actual data that ends up in RAM, after DOS decodes the nibble stream into sector regions

What this means is: disks that do not use DOS 3.3 layout cannot be represented by .dsk; disks that also do not use DOS-style nibble streams cannot be represented by .nib; disks that do not even use standard flux levels cannot be represented by .woz (example, one protection scheme relies on getting different random bitstreams every time you read from a band of half-power flux that's neither clearly 0 nor 1).

If you are curious to see the .a2r files for Ultima IV yourself, 4am included them in Ultima IV extras (woz-a-day collection).zip. The .woz files in that archive were produced by processing that .a2r file with standard interpretation.

When I ran a program to interpret his 3 unprotected .woz files down to .nib and then further down to .dsk I found the results byte-for-byte identical to the ones 4am distributed with the Crack. Since it is the smallest format, and no less accurate than the others (for unprotected data), I prefer it for distributing the Remaster.


P.S. 4am has abandoned that Twitter account, by the way. His daily activity now appears on Mastodon (https://mastodon.social/@a2_4am).

wyatt-wong commented 2 years ago

You are correct, only the Program Disk (boot) is copy protected. The other 3 are standard Apple DOS 3.3 format.

The only value in preserving the copy protection, in my opinion, is as an authentic historical record for study. The existing WOZ release from 4am already achieves this goal: it faithfully represents the disk data exactly as it was in 1985. Modifying such a disk image with fixes inherently invalidates its historical authenticity; the resulting file is properly characterized as an "enhancement" not as a "preservation".

So is there any other advantage to having an "enhanced" edition that also retains the copy protection? I cannot think of one. In fact, I can think of a definite disadvantage: it would be much harder for someone to transfer such a disk image file onto physical disk media that would run properly on a real Apple II machine. It could only be played on an emulator. Eliminating the protection is one of the enhancements offered by the Remaster: to more easily enjoy it on real hardware.

You speak again of "how to apply the patch to the WOZ file" but this is not an accurate description of my project. The phrase "applying a patch" suggests replacing some small-ish amount of binary data with alternate data, without disrupting the data around it. While my Remaster project does this for some game files, it also completely replaces other entire game files. Some of the replacements are larger than the originals! This involves allocating additional sectors in the sector map and adjusting the disk's master table of contents. My Makefile actually constructs an entire disk image from scratch, populated with my rebuilt files, because that is easier than attempting to "patch" them into any existing disk image. See the branch diff for comprehesive details of all the changes I've introduced.

As a side note, WOZ isn't even the most detailed format that exists today. These are the most common file formats for representing Apple 5.25" disks, in decreasing order of size (my apologies if you already know this or aren't interested; perhaps other readers following this thread may find it useful though):

  1. .a2r - measures the variable strength of magnetic flux on the disk media, at a higher resolution than the Apple II disk drive can access
  2. .woz - binary 0/1 bitstream that the Disk II controller would produce by interpreting those variable flux levels at a specific clock interval
  3. .nib - stream of 8-bit "nibbles" that DOS subroutines would produce upon encountering the above bitstream, skipping runs of '0' bits - it includes sector headers, checksums, and other values "invisible" to a typical Apple program that's just trying to read files
  4. .dsk - actual data that ends up in RAM, after DOS decodes the nibble stream into sector regions

What this means is: disks that do not use DOS 3.3 layout cannot be represented by .dsk; disks that also do not use DOS-style nibble streams cannot be represented by .nib; disks that do not even use standard flux levels cannot be represented by .woz (example, one protection scheme relies on getting different random bitstreams every time you read from a band of half-power flux that's neither clearly 0 nor 1).

If you are curious to see the .a2r files for Ultima IV yourself, 4am included them in Ultima IV extras (woz-a-day collection).zip. The .woz files in that archive were produced by processing that .a2r file with standard interpretation.

When I ran a program to interpret his 3 unprotected .woz files down to .nib and then further down to .dsk I found the results byte-for-byte identical to the ones 4am distributed with the Crack. Since it is the smallest format, and no less accurate than the others (for unprotected data), I prefer it for distributing the Remaster.

P.S. 4am has abandoned that Twitter account, by the way. His daily activity now appears on Mastodon (https://mastodon.social/@a2_4am).

Well, you made an excellent point that modifying the original WOZ boot image of Ultima IV with fixes and enhancements will inherently invalidates its historical authenticity, which I haven't thought about it before.

When I said "how to apply the patch to the WOZ file", I thought you simply apply the patches to the cracked DSK files. But as you have mentioned earlier, it is a total rebuilt from the source into the disk images instead of "patching" the cracked DSK files.

I knew the .a2r is about the magnetic flux and I heard about the file format .dsk, .nib. .po but I did not know them in great detail. However, I was curious to know that some files cannot be represented in .WOZ format. I knew the .a2r file is stored in the Ultima IV extras (woz-a-day collection).zip file and that .WOZ file was generated from .a2r. If some files cannot be represented in WOZ file format, that means it couldn't be generated from the .a2r file. In the case, I don't know what kind of Apple II emulators were able run the .a2r file directly

For 4am twitter account, I found it was last updated in Jun 22, I wasn't aware that he use a new account in https://mastodon.social/@a2_4am

sean-gugler commented 2 years ago

I am not aware of any emulators able to run .a2r files, either. Maybe some day!

Closing this issue as "declined".