mirror of
https://github.com/markdavidlong/AppleSAWS.git
synced 2024-12-27 15:29:29 +00:00
Various changes
This commit is contained in:
parent
77c96e8a57
commit
93f1b143d3
@ -36,10 +36,20 @@ FileDescriptiveEntry CatalogSector::makeFDE(int offset)
|
|||||||
fde.firstTSListSector.track = m_data->rawData()[offset + 0x00];
|
fde.firstTSListSector.track = m_data->rawData()[offset + 0x00];
|
||||||
fde.firstTSListSector.sector = m_data->rawData()[offset + 0x01];
|
fde.firstTSListSector.sector = m_data->rawData()[offset + 0x01];
|
||||||
fde.fileTypeAndFlags = m_data->rawData()[offset + 0x02];
|
fde.fileTypeAndFlags = m_data->rawData()[offset + 0x02];
|
||||||
//fde.lengthInSectors = m_data->rawData()[offset + 0x21] + (m_data->rawData()[offset + 0x22] * 256);
|
|
||||||
fde.lengthInSectors = makeWord( m_data->rawData()[offset + 0x21], m_data->rawData()[offset + 0x22]);
|
fde.lengthInSectors = makeWord( m_data->rawData()[offset + 0x21], m_data->rawData()[offset + 0x22]);
|
||||||
for (int idx = 0x03; idx <= 0x20; idx++) {
|
for (int idx = 0x03; idx <= 0x20; idx++) {
|
||||||
fde.filename.append(m_data->rawData()[idx+offset]);
|
fde.filename.append(m_data->rawData()[idx+offset]);
|
||||||
}
|
}
|
||||||
|
if (fde.firstTSListSector.track == 0xFF)
|
||||||
|
{
|
||||||
|
//TODO: Double check this stuff. applevision.dsk is a good example.
|
||||||
|
qDebug() << "File" << fde.filename.printable() << "is deleted";
|
||||||
|
fde.deleted = true;
|
||||||
|
qDebug() << fde.filename;
|
||||||
|
fde.firstTSListSector.track = m_data->rawData()[offset + 0x20];
|
||||||
|
qDebug() << " New track: " << (quint8) fde.firstTSListSector.track;
|
||||||
|
qDebug() << " Sector: " << fde.firstTSListSector.sector;
|
||||||
|
|
||||||
|
}
|
||||||
return fde;
|
return fde;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,14 @@ DiskFile::~DiskFile()
|
|||||||
bool DiskFile::read(QString filename)
|
bool DiskFile::read(QString filename)
|
||||||
{
|
{
|
||||||
m_imageName = QFileInfo(filename).fileName();
|
m_imageName = QFileInfo(filename).fileName();
|
||||||
|
if (m_imageName.toUpper().contains(".D13"))
|
||||||
|
{
|
||||||
|
m_sectors_per_track = 13;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_sectors_per_track = 16;
|
||||||
|
}
|
||||||
|
|
||||||
QFile infile(filename);
|
QFile infile(filename);
|
||||||
QCryptographicHash hash(QCryptographicHash::Md5);
|
QCryptographicHash hash(QCryptographicHash::Md5);
|
||||||
@ -40,7 +48,7 @@ bool DiskFile::read(QString filename)
|
|||||||
QDataStream qds(contents);
|
QDataStream qds(contents);
|
||||||
for (int track = 0; track < 35; track++)
|
for (int track = 0; track < 35; track++)
|
||||||
{
|
{
|
||||||
for (int sector = 0; sector < 16; sector++)
|
for (int sector = 0; sector < m_sectors_per_track; sector++)
|
||||||
{
|
{
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
if (qds.readRawData(buffer,256) == 256)
|
if (qds.readRawData(buffer,256) == 256)
|
||||||
|
@ -47,6 +47,7 @@ private:
|
|||||||
QByteArray m_hash;
|
QByteArray m_hash;
|
||||||
|
|
||||||
QString m_imageName;
|
QString m_imageName;
|
||||||
|
quint8 m_sectors_per_track;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,6 +10,13 @@ struct FileDescriptiveEntry {
|
|||||||
int fileTypeAndFlags;
|
int fileTypeAndFlags;
|
||||||
AppleString filename;
|
AppleString filename;
|
||||||
quint16 lengthInSectors;
|
quint16 lengthInSectors;
|
||||||
|
bool deleted;
|
||||||
|
|
||||||
|
FileDescriptiveEntry() {
|
||||||
|
fileTypeAndFlags = 0;
|
||||||
|
lengthInSectors = 0;
|
||||||
|
deleted = false;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator<(const FileDescriptiveEntry& f1) const {
|
bool operator<(const FileDescriptiveEntry& f1) const {
|
||||||
return f1.filename < filename;
|
return f1.filename < filename;
|
||||||
|
@ -82,7 +82,6 @@ void CatalogWidget::processNewlyLoadedDisk(QString diskfilename, DiskFile *disk)
|
|||||||
QString filetype = fde.fileType();
|
QString filetype = fde.fileType();
|
||||||
QString filename = AppleString(fde.filename).printable().trimmed();
|
QString filename = AppleString(fde.filename).printable().trimmed();
|
||||||
quint16 size = fde.lengthInSectors;
|
quint16 size = fde.lengthInSectors;
|
||||||
qDebug() << "SIZE: " << size;
|
|
||||||
bool locked = fde.isLocked();
|
bool locked = fde.isLocked();
|
||||||
QString sizeStr = QString("%1").arg(size,5,10,QChar(' ')).toUpper();
|
QString sizeStr = QString("%1").arg(size,5,10,QChar(' ')).toUpper();
|
||||||
QString text = QString("%1 %2 %3 %4").arg(locked?"*":" ").arg(sizeStr).arg(filetype).arg(filename);
|
QString text = QString("%1 %2 %3 %4").arg(locked?"*":" ").arg(sizeStr).arg(filetype).arg(filename);
|
||||||
|
@ -59,7 +59,7 @@ bool ApplesoftFileViewer::makeMenuOptions(QMenu *menu)
|
|||||||
|
|
||||||
if (!m_showIntsAction)
|
if (!m_showIntsAction)
|
||||||
{
|
{
|
||||||
m_showIntsAction = new QAction("Show Ints as &Hex",menu);
|
m_showIntsAction = new QAction("Show Ints as &Hex",this);
|
||||||
m_showIntsAction->setCheckable(true);
|
m_showIntsAction->setCheckable(true);
|
||||||
m_showIntsAction->setChecked(settings.value("ASViewer.intsAsHex",false).toBool());
|
m_showIntsAction->setChecked(settings.value("ASViewer.intsAsHex",false).toBool());
|
||||||
setIntsAsHex(settings.value("ASViewer.intsAsHex",false).toBool(),NoReformat);
|
setIntsAsHex(settings.value("ASViewer.intsAsHex",false).toBool(),NoReformat);
|
||||||
@ -70,7 +70,7 @@ bool ApplesoftFileViewer::makeMenuOptions(QMenu *menu)
|
|||||||
|
|
||||||
if (!m_reindentCodeAction)
|
if (!m_reindentCodeAction)
|
||||||
{
|
{
|
||||||
m_reindentCodeAction = new QAction("&Indent code",menu);
|
m_reindentCodeAction = new QAction("&Indent code",this);
|
||||||
m_reindentCodeAction->setCheckable(true);
|
m_reindentCodeAction->setCheckable(true);
|
||||||
m_reindentCodeAction->setChecked(settings.value("ASViewer.indentCode",false).toBool());
|
m_reindentCodeAction->setChecked(settings.value("ASViewer.indentCode",false).toBool());
|
||||||
setIndentCode(settings.value("ASViewer.indentCode",false).toBool(),NoReformat);
|
setIndentCode(settings.value("ASViewer.indentCode",false).toBool(),NoReformat);
|
||||||
@ -81,7 +81,7 @@ bool ApplesoftFileViewer::makeMenuOptions(QMenu *menu)
|
|||||||
|
|
||||||
if (!m_blankAfterReturnsAction)
|
if (!m_blankAfterReturnsAction)
|
||||||
{
|
{
|
||||||
m_blankAfterReturnsAction = new QAction("Blank &Line after RETURNs",menu);
|
m_blankAfterReturnsAction = new QAction("Blank &Line after RETURNs",this);
|
||||||
m_blankAfterReturnsAction->setCheckable(true);
|
m_blankAfterReturnsAction->setCheckable(true);
|
||||||
m_blankAfterReturnsAction->setChecked(settings.value("ASViewer.breakAfterReturn",false).toBool());
|
m_blankAfterReturnsAction->setChecked(settings.value("ASViewer.breakAfterReturn",false).toBool());
|
||||||
setIndentCode(settings.value("ASViewer.breakAfterReturn",false).toBool(),NoReformat);
|
setIndentCode(settings.value("ASViewer.breakAfterReturn",false).toBool(),NoReformat);
|
||||||
@ -92,7 +92,7 @@ bool ApplesoftFileViewer::makeMenuOptions(QMenu *menu)
|
|||||||
|
|
||||||
if (!m_showCtrlCharsAction)
|
if (!m_showCtrlCharsAction)
|
||||||
{
|
{
|
||||||
m_showCtrlCharsAction = new QAction("Show &Control Characters",menu);
|
m_showCtrlCharsAction = new QAction("Show &Control Characters",this);
|
||||||
m_showCtrlCharsAction->setCheckable(true);
|
m_showCtrlCharsAction->setCheckable(true);
|
||||||
m_showCtrlCharsAction->setChecked(settings.value("ASViewer.showCtrlChars",false).toBool());
|
m_showCtrlCharsAction->setChecked(settings.value("ASViewer.showCtrlChars",false).toBool());
|
||||||
setIndentCode(settings.value("ASViewer.showCtrlChars",false).toBool(),NoReformat);
|
setIndentCode(settings.value("ASViewer.showCtrlChars",false).toBool(),NoReformat);
|
||||||
@ -106,7 +106,7 @@ bool ApplesoftFileViewer::makeMenuOptions(QMenu *menu)
|
|||||||
|
|
||||||
if (!m_wordWrapAction)
|
if (!m_wordWrapAction)
|
||||||
{
|
{
|
||||||
m_wordWrapAction = new QAction("&Word Wrap");
|
m_wordWrapAction = new QAction("&Word Wrap",this);
|
||||||
m_wordWrapAction->setCheckable(true);
|
m_wordWrapAction->setCheckable(true);
|
||||||
m_wordWrapAction->setChecked(settings.value("ASViewer.WordWrap",true).toBool());
|
m_wordWrapAction->setChecked(settings.value("ASViewer.WordWrap",true).toBool());
|
||||||
toggleWordWrap(settings.value("ASViewer.WordWrap",true).toBool());
|
toggleWordWrap(settings.value("ASViewer.WordWrap",true).toBool());
|
||||||
@ -116,7 +116,7 @@ bool ApplesoftFileViewer::makeMenuOptions(QMenu *menu)
|
|||||||
|
|
||||||
if (!m_syntaxHighlightingAction)
|
if (!m_syntaxHighlightingAction)
|
||||||
{
|
{
|
||||||
m_syntaxHighlightingAction = new QAction("&Syntax Highlighting",menu);
|
m_syntaxHighlightingAction = new QAction("&Syntax Highlighting",this);
|
||||||
m_syntaxHighlightingAction->setCheckable(true);
|
m_syntaxHighlightingAction->setCheckable(true);
|
||||||
m_syntaxHighlightingAction->setChecked(settings.value("ASViewer.syntaxHighlighting",false).toBool());
|
m_syntaxHighlightingAction->setChecked(settings.value("ASViewer.syntaxHighlighting",false).toBool());
|
||||||
setIndentCode(settings.value("ASViewer.syntaxHighlighting",false).toBool(),NoReformat);
|
setIndentCode(settings.value("ASViewer.syntaxHighlighting",false).toBool(),NoReformat);
|
||||||
@ -131,7 +131,7 @@ bool ApplesoftFileViewer::makeMenuOptions(QMenu *menu)
|
|||||||
|
|
||||||
if (!m_showVarExplorerAction)
|
if (!m_showVarExplorerAction)
|
||||||
{
|
{
|
||||||
m_showVarExplorerAction = new QAction("Show &Variable Explorer...",menu);
|
m_showVarExplorerAction = new QAction("Show &Variable Explorer...",this);
|
||||||
m_showVarExplorerAction->setCheckable(false);
|
m_showVarExplorerAction->setCheckable(false);
|
||||||
connect(m_showVarExplorerAction, SIGNAL(triggered(bool)), SLOT(launchVarBrowser()));
|
connect(m_showVarExplorerAction, SIGNAL(triggered(bool)), SLOT(launchVarBrowser()));
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,10 @@ void ViewerBase::setFile(GenericFile *file)
|
|||||||
QString defaultViewerDescriptor;
|
QString defaultViewerDescriptor;
|
||||||
|
|
||||||
HexDumpViewer *hdv = new HexDumpViewer(0);
|
HexDumpViewer *hdv = new HexDumpViewer(0);
|
||||||
hdv->setFile(file);
|
if (dynamic_cast<ApplesoftFile*>(file))
|
||||||
|
hdv->setFile(file,0x801); //TODO: Double check this offset.
|
||||||
|
else
|
||||||
|
hdv->setFile(file);
|
||||||
descriptor = ("Hex Dump Viewer");
|
descriptor = ("Hex Dump Viewer");
|
||||||
addViewer(descriptor,hdv);
|
addViewer(descriptor,hdv);
|
||||||
defaultViewerDescriptor = descriptor;
|
defaultViewerDescriptor = descriptor;
|
||||||
|
Loading…
Reference in New Issue
Block a user