PGO/Test fixes
This commit is contained in:
parent
8f4f67baee
commit
e2528b004b
3 changed files with 12 additions and 4 deletions
|
@ -49,6 +49,7 @@ int main(int argc, char* argv[])
|
||||||
vector<char*> testRoms{
|
vector<char*> testRoms{
|
||||||
"..\\..\\Games\\Super Dodge Ball (USA).nes",
|
"..\\..\\Games\\Super Dodge Ball (USA).nes",
|
||||||
"..\\..\\Games\\Super Mario Bros. (USA).nes",
|
"..\\..\\Games\\Super Mario Bros. (USA).nes",
|
||||||
|
"..\\..\\Games\\Mega Man (USA).nes",
|
||||||
"..\\..\\Games\\Mega Man 2 (USA).nes",
|
"..\\..\\Games\\Mega Man 2 (USA).nes",
|
||||||
"..\\..\\Games\\Mega Man 3 (USA).nes",
|
"..\\..\\Games\\Mega Man 3 (USA).nes",
|
||||||
"..\\..\\Games\\Mega Man 4 (USA).nes",
|
"..\\..\\Games\\Mega Man 4 (USA).nes",
|
||||||
|
@ -65,8 +66,8 @@ int main(int argc, char* argv[])
|
||||||
"..\\..\\Games\\Dragon Warrior IV (USA).nes"
|
"..\\..\\Games\\Dragon Warrior IV (USA).nes"
|
||||||
};
|
};
|
||||||
|
|
||||||
SetFlags(0x8000000000000000); //EmulationFlags::ConsoleMode
|
SetFlags(0x8000000000000000 | 0x20); //EmulationFlags::ConsoleMode | UseHdPacks
|
||||||
InitializeEmu("C:\\Windows\\Temp\\Mesen", nullptr, nullptr, false, false, false);
|
InitializeEmu("C:\\Code\\PGOMesen", nullptr, nullptr, false, false, false);
|
||||||
LoadROM(testRoms[0], "");
|
LoadROM(testRoms[0], "");
|
||||||
std::cout << "Running: " << testRoms[0] << std::endl;
|
std::cout << "Running: " << testRoms[0] << std::endl;
|
||||||
|
|
||||||
|
|
|
@ -75,8 +75,13 @@ void RunEmu()
|
||||||
|
|
||||||
void __stdcall OnNotificationReceived(ConsoleNotificationType type)
|
void __stdcall OnNotificationReceived(ConsoleNotificationType type)
|
||||||
{
|
{
|
||||||
|
static int count = 0;
|
||||||
if(type == ConsoleNotificationType::GameLoaded) {
|
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;
|
testIndex = 0;
|
||||||
timer.Reset();
|
timer.Reset();
|
||||||
|
|
||||||
int numberOfThreads = 4;
|
int numberOfThreads = 16;
|
||||||
for(int i = 0; i < numberOfThreads; i++) {
|
for(int i = 0; i < numberOfThreads; i++) {
|
||||||
std::thread *testThread = new std::thread(RunTest);
|
std::thread *testThread = new std::thread(RunTest);
|
||||||
testThreads.push_back(testThread);
|
testThreads.push_back(testThread);
|
||||||
|
|
|
@ -48,7 +48,9 @@ bool ZipReader::ExtractFile(string filename, vector<uint8_t> &output)
|
||||||
size_t uncompSize;
|
size_t uncompSize;
|
||||||
void *p = mz_zip_reader_extract_file_to_heap(&_zipArchive, filename.c_str(), &uncompSize, 0);
|
void *p = mz_zip_reader_extract_file_to_heap(&_zipArchive, filename.c_str(), &uncompSize, 0);
|
||||||
if(!p) {
|
if(!p) {
|
||||||
|
#ifdef _DEBUG
|
||||||
std::cout << "mz_zip_reader_extract_file_to_heap() failed!" << std::endl;
|
std::cout << "mz_zip_reader_extract_file_to_heap() failed!" << std::endl;
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue