mirror of
https://github.com/markdavidlong/AppleSAWS.git
synced 2026-04-20 05:16:40 +00:00
Continuing work. Added text view to hex viewer.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#include "binaryfilemetadata.h"
|
||||
|
||||
BinaryFileMetadata::BinaryFileMetadata()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BinaryFileMetadata::addEntryPoint(quint16 address)
|
||||
{
|
||||
if (!containsEntryPoint(address))
|
||||
{
|
||||
m_entryPoints.append(address);
|
||||
qSort(m_entryPoints);
|
||||
}
|
||||
}
|
||||
|
||||
void BinaryFileMetadata::addDataRange(AddressRange range)
|
||||
{
|
||||
m_dataRanges.append(range);
|
||||
}
|
||||
|
||||
bool BinaryFileMetadata::load()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BinaryFileMetadata::save()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BinaryFileMetadata::containsEntryPoint(quint16 address)
|
||||
{
|
||||
return m_entryPoints.contains(address);
|
||||
}
|
||||
|
||||
void BinaryFileMetadata::removeEntryPoint(quint16 address)
|
||||
{
|
||||
if (containsEntryPoint(address))
|
||||
{
|
||||
m_entryPoints.removeAll(address);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
#ifndef BINARYFILEMETADATA_H
|
||||
#define BINARYFILEMETADATA_H
|
||||
|
||||
#include <Qt>
|
||||
#include <QList>
|
||||
|
||||
|
||||
struct AddressRange
|
||||
{
|
||||
public:
|
||||
quint16 start;
|
||||
quint16 end;
|
||||
|
||||
quint16 length() { return end-start; }
|
||||
|
||||
bool contains(quint16 address) { return (address >= start && address <= end); }
|
||||
|
||||
};
|
||||
|
||||
class BinaryFileMetadata
|
||||
{
|
||||
public:
|
||||
enum UseType {
|
||||
UNKNOWN = 0x00,
|
||||
ROM = 0x01,
|
||||
IO = 0x02,
|
||||
BASIC = 0x04,
|
||||
OPCODE = 0x08,
|
||||
DATA = 0x10
|
||||
};
|
||||
|
||||
BinaryFileMetadata();
|
||||
|
||||
void addEntryPoint(quint16 address);
|
||||
void addDataRange(AddressRange range);
|
||||
|
||||
bool load();
|
||||
bool save();
|
||||
|
||||
bool containsEntryPoint(quint16 address);
|
||||
void removeEntryPoint(quint16 address);
|
||||
|
||||
QList<quint16> getEntryPoints() { return m_entryPoints; }
|
||||
QList<AddressRange> getDataRanges() { return m_dataRanges; }
|
||||
|
||||
private:
|
||||
QList<quint16> m_entryPoints;
|
||||
QList<AddressRange> m_dataRanges;
|
||||
|
||||
};
|
||||
|
||||
#endif // BINARYFILEMETADATA_H
|
||||
Reference in New Issue
Block a user