PGO/Test fixes

This commit is contained in:
Sour 2017-12-28 16:52:49 -05:00
parent 8f4f67baee
commit e2528b004b
3 changed files with 12 additions and 4 deletions

View File

@ -49,6 +49,7 @@ int main(int argc, char* argv[])
vector<char*> testRoms{
"..\\..\\Games\\Super Dodge Ball (USA).nes",
"..\\..\\Games\\Super Mario Bros. (USA).nes",
"..\\..\\Games\\Mega Man (USA).nes",
"..\\..\\Games\\Mega Man 2 (USA).nes",
"..\\..\\Games\\Mega Man 3 (USA).nes",
"..\\..\\Games\\Mega Man 4 (USA).nes",
@ -65,8 +66,8 @@ int main(int argc, char* argv[])
"..\\..\\Games\\Dragon Warrior IV (USA).nes"
};
SetFlags(0x8000000000000000); //EmulationFlags::ConsoleMode
InitializeEmu("C:\\Windows\\Temp\\Mesen", nullptr, nullptr, false, false, false);
SetFlags(0x8000000000000000 | 0x20); //EmulationFlags::ConsoleMode | UseHdPacks
InitializeEmu("C:\\Code\\PGOMesen", nullptr, nullptr, false, false, false);
LoadROM(testRoms[0], "");
std::cout << "Running: " << testRoms[0] << std::endl;

View File

@ -75,8 +75,13 @@ void RunEmu()
void __stdcall OnNotificationReceived(ConsoleNotificationType type)
{
static int count = 0;
if(type == ConsoleNotificationType::GameLoaded) {
runThread = new std::thread(RunEmu);
count++;
if(count % 2 == 0) {
//GameLoaded is fired twice because of how the test roms are coded, we want to start running the test on the 2nd time only
runThread = new std::thread(RunEmu);
}
}
}
@ -171,7 +176,7 @@ int main(int argc, char* argv[])
testIndex = 0;
timer.Reset();
int numberOfThreads = 4;
int numberOfThreads = 16;
for(int i = 0; i < numberOfThreads; i++) {
std::thread *testThread = new std::thread(RunTest);
testThreads.push_back(testThread);

View File

@ -48,7 +48,9 @@ bool ZipReader::ExtractFile(string filename, vector<uint8_t> &output)
size_t uncompSize;
void *p = mz_zip_reader_extract_file_to_heap(&_zipArchive, filename.c_str(), &uncompSize, 0);
if(!p) {
#ifdef _DEBUG
std::cout << "mz_zip_reader_extract_file_to_heap() failed!" << std::endl;
#endif
return false;
}