Fix new project to write full ROM.oxfs buffer

This commit is contained in:
Gary Talent 2017-05-27 04:14:23 -05:00
parent 287168a6cc
commit 04211bb1ac

View File

@ -37,7 +37,7 @@ void Project::create() {
QFile file(m_path + ROM_FILE); QFile file(m_path + ROM_FILE);
file.open(QIODevice::WriteOnly); file.open(QIODevice::WriteOnly);
file.write((const char*) buff); file.write((const char*) buff, buffSize);
file.close(); file.close();
} }
@ -48,13 +48,17 @@ int Project::openRomFs() {
if (file.exists()) { if (file.exists()) {
file.open(QIODevice::ReadOnly); file.open(QIODevice::ReadOnly);
if (file.read((char*) buff, buffSize) > 0) { if (file.read((char*) buff, buffSize) > 0) {
m_fs = createFileSystem((uint8_t*) buff, buffSize, true); m_fs = createFileSystem(buff, buffSize, true);
return 0; if (m_fs) {
return 0;
} else {
return 1;
}
} else { } else {
return 1; return 2;
} }
} else { } else {
return 2; return 3;
} }
} }