View Single Post
Old 19 December 2008, 19:16   #3
Supamax
Da Digger :)

Supamax's Avatar
 
Join Date: Nov 2008
Location: Monza, Italy
Posts: 2,476
Quote:
Originally Posted by Redwood View Post
It is not easy to merge two rawread images. The RAW (or extended ADF) format begins with a 2004 byte header and looks something like this:

Code:
bytes        description
------------------------
0-7          Magic: "UAE-1ADF"
8-11         Number of tracks
12-15        Type of cylinder 0, side 1. (0 = DOS, 1 = RAW)
16-19        Number of bytes in cylinder 0, side 1
20-23        Number of bits in cylinder 0, side 1
24-27        Type of cylinder 0, side 2. (0 = DOS, 1 = RAW)
28-31        Number of bytes in cylinder 0, side 2
32-35        Number of bits in cylinder 0, side 2
36-39        Type of cylinder 1, side 1. (0 = DOS, 1 = RAW)
...
2004-?       Data for cylinder 0, side 1. (Length of data at 16-19)
?-?          Data for cylinder 0, side 2. (Length of data at 28-31)
...
Now, if you make a partial images, the first 2004 bytes of each image will still contain the full header, but the length field for the cylinders you skipped will be zero, and therefore the length of the data for that cylinder later in the file will also be zero.

So to merge partial RAW images, you'll have to read the header information from each partial image, merge it, then read the cylinder data from each partial image into a new image. If you have overlapping partial images, you'll have to be careful to write each cylinder only once.

I have some python code which makes this somewhat easier if anyone's interested.
Yes, I would be interested... did you manage to understand how data is coded from position 2004 on?
Supamax is offline  
 
Page generated in 0.04780 seconds with 9 queries