mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2025-01-03 10:29:19 +00:00
Write complete GEOS meta-data to directory entries
This commit is contained in:
parent
199b36d5a6
commit
6b05f34529
@ -123,12 +123,7 @@ public class ProdosFileEntry extends ProdosCommonEntry implements FileEntry {
|
|||||||
if (isDeleted()) {
|
if (isDeleted()) {
|
||||||
AppleUtil.setString(fileEntry, 1, filename.toUpperCase(), 15);
|
AppleUtil.setString(fileEntry, 1, filename.toUpperCase(), 15);
|
||||||
} else {
|
} else {
|
||||||
if (isGEOSFile()) {
|
AppleUtil.setProdosString(fileEntry, 0, filename.toUpperCase(), 15);
|
||||||
// No need to upper-case or be picky about GEOS filenames
|
|
||||||
AppleUtil.setProdosString(fileEntry, 0, filename, 15);
|
|
||||||
} else {
|
|
||||||
AppleUtil.setProdosString(fileEntry, 0, filename.toUpperCase(), 15);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (isAppleWorksFile()) {
|
if (isAppleWorksFile()) {
|
||||||
byte lowByte = 0;
|
byte lowByte = 0;
|
||||||
@ -147,6 +142,23 @@ public class ProdosFileEntry extends ProdosCommonEntry implements FileEntry {
|
|||||||
writeFileEntry(fileEntry);
|
writeFileEntry(fileEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy GEOS-specific metadata to the directory entry verbatim:
|
||||||
|
* Bytes $00-$10 ($11 bytes)
|
||||||
|
* Bytes $18-$1d ($06 bytes)
|
||||||
|
* Bytes $21-$24 ($04 bytes)
|
||||||
|
*/
|
||||||
|
public void setGEOSMeta(byte[] metaData) {
|
||||||
|
byte[] fileEntry = readFileEntry();
|
||||||
|
// GEOS metadata lives at $180 offset from the beginning of the first block.
|
||||||
|
// Copy that to the file entry, skipping the bytes that are locally created
|
||||||
|
// (i.e. pointers, etc.)
|
||||||
|
System.arraycopy(metaData,0x180+0x00,fileEntry,0x00,0x11);
|
||||||
|
System.arraycopy(metaData,0x180+0x18,fileEntry,0x18,0x06);
|
||||||
|
System.arraycopy(metaData,0x180+0x21,fileEntry,0x21,0x04);
|
||||||
|
writeFileEntry(fileEntry);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the filetype of this file. This will be three characters,
|
* Return the filetype of this file. This will be three characters,
|
||||||
* according to ProDOS - a "$xx" if unknown.
|
* according to ProDOS - a "$xx" if unknown.
|
||||||
|
@ -755,6 +755,7 @@ public class ProdosFormatDisk extends FormattedDisk {
|
|||||||
} else {
|
} else {
|
||||||
setGEOSTreeData(bitmap, fileEntry, fileData);
|
setGEOSTreeData(bitmap, fileEntry, fileData);
|
||||||
}
|
}
|
||||||
|
fileEntry.setGEOSMeta(headerData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user