apvr eatavel eao rso jyrsovrs
to-do: - make an "exporting ROM" dialog with progress and all - move TIunA export to the ROM export framework - perhaps do the same with ZSM in the future?
This commit is contained in:
parent
48523add00
commit
a4aa408912
8 changed files with 80 additions and 72 deletions
|
|
@ -697,9 +697,8 @@ class DivEngine {
|
|||
// save as .fur.
|
||||
// if notPrimary is true then the song will not be altered
|
||||
SafeWriter* saveFur(bool notPrimary=false, bool newPatternFormat=true);
|
||||
// build a ROM file (TODO).
|
||||
// specify system to build ROM for.
|
||||
std::vector<DivROMExportOutput> buildROM(DivROMExportOptions sys);
|
||||
// return a ROM exporter.
|
||||
DivROMExport* buildROM(DivROMExportOptions sys);
|
||||
// dump to VGM.
|
||||
// set trailingTicks to:
|
||||
// - 0 to add one tick of trailing
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include "export/amigaValidation.h"
|
||||
|
||||
std::vector<DivROMExportOutput> DivEngine::buildROM(DivROMExportOptions sys) {
|
||||
DivROMExport* DivEngine::buildROM(DivROMExportOptions sys) {
|
||||
DivROMExport* exporter=NULL;
|
||||
switch (sys) {
|
||||
case DIV_ROM_AMIGA_VALIDATION:
|
||||
|
|
@ -31,7 +31,5 @@ std::vector<DivROMExportOutput> DivEngine::buildROM(DivROMExportOptions sys) {
|
|||
exporter=new DivROMExport;
|
||||
break;
|
||||
}
|
||||
std::vector<DivROMExportOutput> ret=exporter->go(this);
|
||||
delete exporter;
|
||||
return ret;
|
||||
return exporter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,13 +51,16 @@ struct DivROMExportProgress {
|
|||
};
|
||||
|
||||
class DivROMExport {
|
||||
std::vector<String> exportLog;
|
||||
std::mutex logLock;
|
||||
void logAppend(String what);
|
||||
protected:
|
||||
std::vector<String> exportLog;
|
||||
std::vector<DivROMExportOutput> output;
|
||||
std::mutex logLock;
|
||||
void logAppend(String what);
|
||||
public:
|
||||
virtual bool go(DivEngine* eng);
|
||||
virtual void abort();
|
||||
virtual std::vector<DivROMExportOutput> getResult();
|
||||
virtual void wait();
|
||||
std::vector<DivROMExportOutput>& getResult();
|
||||
virtual bool hasFailed();
|
||||
virtual DivROMExportProgress getProgress();
|
||||
virtual ~DivROMExport() {}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,34 @@
|
|||
#include "../export.h"
|
||||
#include "../../ta-log.h"
|
||||
|
||||
std::vector<DivROMExportOutput> DivROMExport::go(DivEngine* e) {
|
||||
bool DivROMExport::go(DivEngine* eng) {
|
||||
logW("what's this? the null ROM export?");
|
||||
return std::vector<DivROMExportOutput>();
|
||||
return false;
|
||||
}
|
||||
|
||||
void DivROMExport::abort() {
|
||||
}
|
||||
|
||||
std::vector<DivROMExportOutput>& DivROMExport::getResult() {
|
||||
return output;
|
||||
}
|
||||
|
||||
bool DivROMExport::hasFailed() {
|
||||
return true;
|
||||
}
|
||||
|
||||
DivROMExportProgress DivROMExport::getProgress() {
|
||||
DivROMExportProgress ret;
|
||||
ret.name="Test";
|
||||
ret.amount=0.0f;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void DivROMExport::logAppend(String what) {
|
||||
logLock.lock();
|
||||
exportLog.push_back(what);
|
||||
logLock.unlock();
|
||||
}
|
||||
|
||||
void DivROMExport::wait() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,8 +40,7 @@ struct SampleBookEntry {
|
|||
len(0) {}
|
||||
};
|
||||
|
||||
std::vector<DivROMExportOutput> DivExportAmigaValidation::go(DivEngine* e) {
|
||||
std::vector<DivROMExportOutput> ret;
|
||||
void DivExportAmigaValidation::run() {
|
||||
std::vector<WaveEntry> waves;
|
||||
std::vector<SampleBookEntry> sampleBook;
|
||||
unsigned int wavesDataPtr=0;
|
||||
|
|
@ -266,12 +265,16 @@ std::vector<DivROMExportOutput> DivExportAmigaValidation::go(DivEngine* e) {
|
|||
}
|
||||
|
||||
// finish
|
||||
ret.reserve(5);
|
||||
ret.push_back(DivROMExportOutput("sbook.bin",sbook));
|
||||
ret.push_back(DivROMExportOutput("wbook.bin",wbook));
|
||||
ret.push_back(DivROMExportOutput("sample.bin",sample));
|
||||
ret.push_back(DivROMExportOutput("wave.bin",wave));
|
||||
ret.push_back(DivROMExportOutput("seq.bin",seq));
|
||||
|
||||
return ret;
|
||||
output.reserve(5);
|
||||
output.push_back(DivROMExportOutput("sbook.bin",sbook));
|
||||
output.push_back(DivROMExportOutput("wbook.bin",wbook));
|
||||
output.push_back(DivROMExportOutput("sample.bin",sample));
|
||||
output.push_back(DivROMExportOutput("wave.bin",wave));
|
||||
output.push_back(DivROMExportOutput("seq.bin",seq));
|
||||
}
|
||||
|
||||
bool DivExportAmigaValidation::go(DivEngine* eng) {
|
||||
e=eng;
|
||||
exportThread=new std::thread(&DivExportAmigaValidation::run,this);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,10 @@
|
|||
#include "../export.h"
|
||||
|
||||
class DivExportAmigaValidation: public DivROMExport {
|
||||
DivEngine* e;
|
||||
std::thread* exportThread;
|
||||
void run();
|
||||
public:
|
||||
std::vector<DivROMExportOutput> go(DivEngine* e);
|
||||
bool go(DivEngine* e);
|
||||
~DivExportAmigaValidation() {}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue