CP/M: added support for Microsoft Softcard "data only" disks.

CP/M: correctly identify 3.x disks
Updated some copyright notices.
This commit is contained in:
Andy McFadden 2009-01-03 19:02:13 +00:00
parent 5fdc2513f3
commit 732cd85ce5
11 changed files with 55 additions and 40 deletions

View File

@ -5,9 +5,9 @@ http://www.faddensoft.com/
CiderPress CiderPress
http://ciderpress.sourceforge.net/ http://ciderpress.sourceforge.net/
3.0.1 3.0.1
39815 39816
C:\DATA\faddenSoft\fs.ico C:\DATA\faddenSoft\fs.ico
Copyright © 2009 faddenSoft, LLC. All rights reserved. Copyright © 2009 CiderPress project authors. All rights reserved.
C:\Src\CiderPress\DIST\ReadMe.txt C:\Src\CiderPress\DIST\ReadMe.txt
C:\Src\CiderPress\DIST\License.txt C:\Src\CiderPress\DIST\License.txt

View File

@ -1,4 +1,4 @@
Copyright (c) 2007, FaddenSoft, LLC Copyright (c) 2009, CiderPress project authors
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@ -217,27 +217,27 @@ END
// Dialog // Dialog
// //
IDD_ABOUTDLG DIALOGEX 0, 0, 212, 154 IDD_ABOUTDLG DIALOGEX 0, 0, 237, 154
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU WS_SYSMENU
CAPTION "About CiderPress" CAPTION "About CiderPress"
FONT 8, "MS Sans Serif" FONT 8, "MS Sans Serif"
BEGIN BEGIN
DEFPUSHBUTTON "OK",IDOK,7,132,50,14 DEFPUSHBUTTON "OK",IDOK,7,132,50,14
PUSHBUTTON "Credits",IDC_ABOUT_CREDITS,63,132,50,14,0,0, PUSHBUTTON "Credits",IDC_ABOUT_CREDITS,77,132,50,14,0,0,
HIDC_ABOUT_CREDITS HIDC_ABOUT_CREDITS
PUSHBUTTON "Enter registration code",IDC_ABOUT_ENTER_REG,119,132,86, PUSHBUTTON "Enter registration code",IDC_ABOUT_ENTER_REG,144,132,86,
14 14
CONTROL 106,IDC_STATIC,"Static",SS_BITMAP,7,6,64,59 CONTROL 106,IDC_STATIC,"Static",SS_BITMAP,7,6,64,59
LTEXT "CiderPress v%d.%d.%d%s%s",IDC_CIDERPRESS_VERS_TEXT,77,7, LTEXT "CiderPress v%d.%d.%d%s%s",IDC_CIDERPRESS_VERS_TEXT,77,7,
128,9 153,9
LTEXT "Copyright © 2009 by FaddenSoft, LLC.\rAll Rights Reserved.", LTEXT "Copyright © 2009 by CiderPress project authors\rAll Rights Reserved.",
IDC_STATIC,77,20,128,19 IDC_STATIC,77,20,153,19
ICON IDR_MAINFRAME,IDC_STATIC,77,45,20,20 ICON IDR_MAINFRAME,IDC_STATIC,77,45,21,20
ICON IDI_FILE_NUFX,IDC_STATIC,106,45,20,20 ICON IDI_FILE_NUFX,IDC_STATIC,106,45,21,20
ICON IDI_FILE_BINARY2,IDC_STATIC,136,45,20,20 ICON IDI_FILE_BINARY2,IDC_STATIC,136,45,21,20
ICON IDI_FILE_DISKIMAGE,IDC_STATIC,166,45,20,20 ICON IDI_FILE_DISKIMAGE,IDC_STATIC,166,45,21,20
GROUPBOX "Libraries",IDC_STATIC,7,71,198,56 GROUPBOX "Libraries",IDC_STATIC,7,71,223,56
LTEXT "Using NufxLib DLL v%d.%d.%d",IDC_NUFXLIB_VERS_TEXT,16, LTEXT "Using NufxLib DLL v%d.%d.%d",IDC_NUFXLIB_VERS_TEXT,16,
82,170,10 82,170,10
LTEXT "Using DiskImg DLL v%d.%d.%d",IDC_DISKIMG_VERS_TEXT,16, LTEXT "Using DiskImg DLL v%d.%d.%d",IDC_DISKIMG_VERS_TEXT,16,
@ -1577,16 +1577,16 @@ BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "Comments", "The end is nigh.\0" VALUE "Comments", "The end is nigh.\0"
VALUE "CompanyName", "FaddenSoft, LLC\0" VALUE "CompanyName", "CiderPress Project\0"
VALUE "FileDescription", "CiderPress\0" VALUE "FileDescription", "CiderPress\0"
VALUE "FileVersion", "2, 4, 6, 0\0" VALUE "FileVersion", "3, 0, 1, 0\0"
VALUE "InternalName", "CiderPress\0" VALUE "InternalName", "CiderPress\0"
VALUE "LegalCopyright", "Copyright © 2007 FaddenSoft, LLC\0" VALUE "LegalCopyright", "Copyright © 2009 CiderPress project authors\0"
VALUE "LegalTrademarks", "\0" VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "CiderPress.exe\0" VALUE "OriginalFilename", "CiderPress.exe\0"
VALUE "PrivateBuild", "\0" VALUE "PrivateBuild", "\0"
VALUE "ProductName", "CiderPress\0" VALUE "ProductName", "CiderPress\0"
VALUE "ProductVersion", "2, 4, 6, 0\0" VALUE "ProductVersion", "3, 0, 1, 0\0"
VALUE "SpecialBuild", "\0" VALUE "SpecialBuild", "\0"
END END
END END
@ -1609,7 +1609,7 @@ GUIDELINES DESIGNINFO DISCARDABLE
BEGIN BEGIN
IDD_ABOUTDLG, DIALOG IDD_ABOUTDLG, DIALOG
BEGIN BEGIN
RIGHTMARGIN, 205 RIGHTMARGIN, 230
VERTGUIDE, 7 VERTGUIDE, 7
VERTGUIDE, 16 VERTGUIDE, 16
VERTGUIDE, 77 VERTGUIDE, 77

Binary file not shown.

Binary file not shown.

View File

@ -20,7 +20,7 @@
#define kAppMajorVersion 3 #define kAppMajorVersion 3
#define kAppMinorVersion 0 #define kAppMinorVersion 0
#define kAppBugVersion 1 #define kAppBugVersion 1
#define kAppDevString "a1" #define kAppDevString "a2"
/* /*
* Windows application object. * Windows application object.

View File

@ -12,6 +12,8 @@
* - Rumor has it that "sparse" files are possible. Not handled. * - Rumor has it that "sparse" files are possible. Not handled.
* - I'm currently treating the directory as fixed-length. This may * - I'm currently treating the directory as fixed-length. This may
* not be correct. * not be correct.
* - Not handling special entries (volume label, date stamps,
* password control).
* *
* As I have no practical experience with CP/M, this is the weakest of the * As I have no practical experience with CP/M, this is the weakest of the
* filesystem implementations. * filesystem implementations.
@ -31,6 +33,7 @@ const int kVolDirBlock = 24; // track 3 sector 0
const int kVolDirCount = 4; // 4 prodos blocks const int kVolDirCount = 4; // 4 prodos blocks
const int kNoDataByte = 0xe5; const int kNoDataByte = 0xe5;
const int kMaxUserNumber = 31; // 0-15 on some systems, 0-31 on others const int kMaxUserNumber = 31; // 0-15 on some systems, 0-31 on others
const int kMaxSpecialUserNumber = 0x21; // 0x20 and 0x21 have special meanings
const int kMaxExtent = 31; // extent counter, 0-31 const int kMaxExtent = 31; // extent counter, 0-31
/* /*
@ -59,8 +62,12 @@ TestImage(DiskImg* pImg, DiskImg::SectorOrder imageOrder)
for (i = 0; i < DiskFSCPM::kFullDirSize/DiskFSCPM::kDirectoryEntryLen; i++) for (i = 0; i < DiskFSCPM::kFullDirSize/DiskFSCPM::kDirectoryEntryLen; i++)
{ {
if (*dptr != kNoDataByte) { if (*dptr != kNoDataByte) {
/* usually userNumber == 0, but sometimes not; must be <= 31 */ /*
if (*dptr > kMaxUserNumber) { * Usually userNumber is 0, but sometimes not. It's expected to
* be < 0x20 for a normal file, may be 0x21 or 0x22 for special
* entries (volume label, date stamps).
*/
if (*dptr > kMaxSpecialUserNumber) {
dierr = kDIErrFilesystemNotFound; dierr = kDIErrFilesystemNotFound;
break; break;
} }
@ -70,11 +77,6 @@ TestImage(DiskImg* pImg, DiskImg::SectorOrder imageOrder)
dierr = kDIErrFilesystemNotFound; dierr = kDIErrFilesystemNotFound;
break; break;
} }
/* value in S1 must be zero */
if (dptr[13] != 0) {
dierr = kDIErrFilesystemNotFound;
break;
}
/* check for a valid filename here; high bit may be set on some bytes */ /* check for a valid filename here; high bit may be set on some bytes */
unsigned char firstLet = *(dptr+1) & 0x7f; unsigned char firstLet = *(dptr+1) & 0x7f;
@ -214,6 +216,11 @@ DiskFSCPM::ReadCatalog(void)
if (fDirEntry[i].userNumber == kNoDataByte || fDirEntry[i].extent != 0) if (fDirEntry[i].userNumber == kNoDataByte || fDirEntry[i].extent != 0)
continue; continue;
if (fDirEntry[i].userNumber > kMaxUserNumber) {
/* skip over volume label, date stamps, etc */
WMSG1("Skipping entry with userNumber=0x%02x\n",
fDirEntry[i].userNumber);
}
pFile = new A2FileCPM(this, fDirEntry); pFile = new A2FileCPM(this, fDirEntry);
FormatName(pFile->fFileName, (char*)fDirEntry[i].fileName); FormatName(pFile->fFileName, (char*)fDirEntry[i].fileName);
@ -620,8 +627,13 @@ A2FDCPM::Read(void* buf, size_t len, size_t* pActual)
/* /*
* Read one CP/M block (two ProDOS blocks) and pull out the * Read one CP/M block (two ProDOS blocks) and pull out the
* set of data that the user wants. * set of data that the user wants.
*
* On some Microsoft Softcard disks, the first three tracks hold
* file data rather than the system image.
*/ */
prodosBlock = DiskFSCPM::CPMToProDOSBlock(fBlockList[blkIndex]); prodosBlock = DiskFSCPM::CPMToProDOSBlock(fBlockList[blkIndex]);
if (prodosBlock >= 280)
prodosBlock -= 280;
dierr = fpFile->GetDiskFS()->GetDiskImg()->ReadBlock(prodosBlock, dierr = fpFile->GetDiskFS()->GetDiskImg()->ReadBlock(prodosBlock,
blkBuf); blkBuf);

View File

@ -42,8 +42,8 @@ namespace DiskImgLib {
/* compiled-against versions; call DiskImg::GetVersion for linked-against */ /* compiled-against versions; call DiskImg::GetVersion for linked-against */
#define kDiskImgVersionMajor 4 #define kDiskImgVersionMajor 4
#define kDiskImgVersionMinor 5 #define kDiskImgVersionMinor 6
#define kDiskImgVersionBug 2 #define kDiskImgVersionBug 0
/* /*

View File

@ -2217,7 +2217,7 @@ public:
}; };
// Contents of the raw 32-byte directory entry. // Contents of the raw 32-byte directory entry.
// //
// From http://www.seasip.demon.co.uk/Cpm/format22.html // From http://www.seasip.demon.co.uk/Cpm/format31.html
// //
// UU F1 F2 F3 F4 F5 F6 F7 F8 T1 T2 T3 EX S1 S2 RC .FILENAMETYP.... // UU F1 F2 F3 F4 F5 F6 F7 F8 T1 T2 T3 EX S1 S2 RC .FILENAMETYP....
// AL AL AL AL AL AL AL AL AL AL AL AL AL AL AL AL ................ // AL AL AL AL AL AL AL AL AL AL AL AL AL AL AL AL ................
@ -2225,13 +2225,16 @@ public:
// If the high bit of T1 is set, the file is read-only. If the high // If the high bit of T1 is set, the file is read-only. If the high
// bit of T2 is set, the file is a "system" file. // bit of T2 is set, the file is a "system" file.
// //
// An entry with UU=0x20 indicates a CP/M 3.1 disk label entry.
// An entry with UU=0x21 indicates a time stamp entry (2.x or 3.x).
//
// Files larger than (1024 * 16) have multiple "extent" entries, i.e. // Files larger than (1024 * 16) have multiple "extent" entries, i.e.
// entries with the same user number and file name. // entries with the same user number and file name.
typedef struct DirEntry { typedef struct DirEntry {
unsigned char userNumber; // 0-15 or 0-31 (usually 0), e5=unused unsigned char userNumber; // 0-15 or 0-31 (usually 0), e5=unused
unsigned char fileName[kDirFileNameLen+1]; unsigned char fileName[kDirFileNameLen+1];
unsigned short extent; // extent (EX + S2 * 32) unsigned short extent; // extent (EX + S2 * 32)
unsigned char S1; // reserved, should be zero unsigned char S1; // Last Record Byte Count (app-specific)
unsigned char records; // #of 128-byte records in this extent unsigned char records; // #of 128-byte records in this extent
unsigned char blocks[kDirEntryBlockCount]; unsigned char blocks[kDirEntryBlockCount];
bool readOnly; bool readOnly;

View File

@ -11,10 +11,10 @@ LastPage=0
ClassCount=2 ClassCount=2
ResourceCount=4 ResourceCount=4
Resource1=IDC_MDC Resource1=IDD_ABOUTBOX
Class1=AboutDlg Class1=AboutDlg
Resource2="IDD_CHOOSE_FILES" Resource2="IDD_CHOOSE_FILES"
Resource3=IDD_ABOUTBOX Resource3=IDC_MDC
Class2=ProgressDlg Class2=ProgressDlg
Resource4=IDD_PROGRESS Resource4=IDD_PROGRESS

View File

@ -70,19 +70,19 @@ END
// Dialog // Dialog
// //
IDD_ABOUTBOX DIALOG DISCARDABLE 22, 17, 133, 111 IDD_ABOUTBOX DIALOG DISCARDABLE 22, 17, 156, 111
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "About" CAPTION "About"
FONT 10, "MS Sans Serif" FONT 10, "MS Sans Serif"
BEGIN BEGIN
ICON IDI_MDC,IDC_MYICON,7,7,20,20 ICON IDI_MDC,IDC_MYICON,7,7,20,20
LTEXT "MDC version %d.%d.%d",IDC_ABOUT_VERS,33,7,93,8, LTEXT "MDC version %d.%d.%d",IDC_ABOUT_VERS,33,7,116,8,
SS_NOPREFIX SS_NOPREFIX
LTEXT "Copyright © 2007 by FaddenSoft, LLC.\rAll Rights Reserved.", LTEXT "Copyright © 2009 by CiderPress project authors.\rAll Rights Reserved.",
IDC_STATIC,7,31,119,19 IDC_STATIC,7,31,142,19
DEFPUSHBUTTON "OK",IDOK,41,90,50,14 DEFPUSHBUTTON "OK",IDOK,53,90,50,14
LTEXT "This utility scans Apple II disk images and creates formatted listings of the files in them.", LTEXT "This utility scans Apple II disk images and creates formatted listings of the files in them.",
IDC_STATIC,7,58,119,26 IDC_STATIC,7,58,142,26
LTEXT "Multi-Disk Catalog",IDC_STATIC,33,15,55,8 LTEXT "Multi-Disk Catalog",IDC_STATIC,33,15,55,8
END END
@ -148,7 +148,7 @@ BEGIN
IDD_ABOUTBOX, DIALOG IDD_ABOUTBOX, DIALOG
BEGIN BEGIN
LEFTMARGIN, 7 LEFTMARGIN, 7
RIGHTMARGIN, 126 RIGHTMARGIN, 149
VERTGUIDE, 33 VERTGUIDE, 33
TOPMARGIN, 7 TOPMARGIN, 7
BOTTOMMARGIN, 104 BOTTOMMARGIN, 104