mirror of
https://github.com/markdavidlong/AppleSAWS.git
synced 2024-12-01 13:49:22 +00:00
22 lines
398 B
C++
22 lines
398 B
C++
|
#include "memory.h"
|
||
|
#include <QDebug>
|
||
|
|
||
|
Memory::Memory()
|
||
|
{
|
||
|
quint8 zero = 0;
|
||
|
for (int idx = 0; idx < 65536; idx++) {
|
||
|
m_memory.append(zero);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
bool Memory::addFile(QByteArray data, quint16 start)
|
||
|
{
|
||
|
if (start+data.length() > 65536) {
|
||
|
qDebug() << "Memory overflow adding data."; return false;
|
||
|
}
|
||
|
|
||
|
m_memory.replace(start,data.length(),data);
|
||
|
|
||
|
return true;
|
||
|
}
|