From 8095b259057bee3cc45dcbf99976c00ed0c5edcc Mon Sep 17 00:00:00 2001 From: Souryo Date: Mon, 28 Dec 2015 09:56:51 -0500 Subject: [PATCH] Fixes for PGO --- Core/VideoDecoder.cpp | 4 +++- Core/VideoDecoder.h | 2 +- PGOHelper/PGOHelper.cpp | 15 +++++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Core/VideoDecoder.cpp b/Core/VideoDecoder.cpp index e061f862..a4b18d7d 100644 --- a/Core/VideoDecoder.cpp +++ b/Core/VideoDecoder.cpp @@ -198,7 +198,9 @@ void VideoDecoder::DecodeThread() } DecodeFrame(); - _renderer->UpdateFrame(_frameBuffer); + if(_renderer) { + _renderer->UpdateFrame(_frameBuffer); + } _waitForRender.Signal(); } diff --git a/Core/VideoDecoder.h b/Core/VideoDecoder.h index fcff3100..7257e8d2 100644 --- a/Core/VideoDecoder.h +++ b/Core/VideoDecoder.h @@ -16,7 +16,7 @@ class VideoDecoder private: static unique_ptr Instance; - IRenderingDevice* _renderer; + IRenderingDevice* _renderer = nullptr; uint16_t *_ppuOutputBuffer = nullptr; HdPpuPixelInfo *_hdScreenTiles = nullptr; diff --git a/PGOHelper/PGOHelper.cpp b/PGOHelper/PGOHelper.cpp index f551cfd4..b809d804 100644 --- a/PGOHelper/PGOHelper.cpp +++ b/PGOHelper/PGOHelper.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -13,19 +14,21 @@ int main(int argc, char* argv[]) { using namespace std; vector testRoms{ - "..\\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" + "..\\..\\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" }; InitializeEmu("C:\\Windows\\Temp\\Mesen", nullptr, nullptr); LoadROM(testRoms[0]); + std::cout << "Running: " << testRoms[0] << std::endl; thread testThread([testRoms] { for(size_t i = 1; i < testRoms.size(); i++) { std::this_thread::sleep_for(std::chrono::duration(5000)); + std::cout << "Running: " << testRoms[i] << std::endl; LoadROM(testRoms[i]); } Stop();