Mesen-X/PGOHelper/PGOHelper.cpp

41 lines
1 KiB
C++
Raw Normal View History

2015-12-28 09:56:51 -05:00
#include <iostream>
2015-08-23 11:45:13 -04:00
#include <thread>
#include <vector>
#include <string>
extern "C" {
2015-08-23 11:45:13 -04:00
void __stdcall InitializeEmu(char* homeFolder, void*, void*);
void __stdcall LoadROM(char* filename);
void __stdcall Run();
2015-08-23 11:45:13 -04:00
void __stdcall Stop();
}
int main(int argc, char* argv[])
{
2015-08-23 11:45:13 -04:00
using namespace std;
vector<char*> testRoms{
2015-12-28 09:56:51 -05:00
"..\\..\\Games\\Super Dodge Ball (USA).nes",
"..\\..\\Games\\Super Mario Bros. (USA).nes",
"..\\..\\Games\\Mega Man 2 (USA).nes",
"..\\..\\Games\\Mega Man 3 (USA).nes",
"..\\..\\Games\\Mega Man 4 (USA).nes",
"..\\..\\Games\\MMC5\\Just Breed (J) [!].nes"
2015-08-23 11:45:13 -04:00
};
InitializeEmu("C:\\Windows\\Temp\\Mesen", nullptr, nullptr);
LoadROM(testRoms[0]);
2015-12-28 09:56:51 -05:00
std::cout << "Running: " << testRoms[0] << std::endl;
2015-08-23 11:45:13 -04:00
thread testThread([testRoms] {
2015-08-23 13:12:47 -04:00
for(size_t i = 1; i < testRoms.size(); i++) {
2015-08-23 11:45:13 -04:00
std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(5000));
2015-12-28 09:56:51 -05:00
std::cout << "Running: " << testRoms[i] << std::endl;
2015-08-23 11:45:13 -04:00
LoadROM(testRoms[i]);
}
Stop();
});
Run();
2015-08-23 11:45:13 -04:00
testThread.join();
return 0;
}