commit d858f6d910ba427e1dd928e1bf5d90adee2562fd
parent 67c82c8be8dc4e817ef2c1a00ade650e31833d42
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Fri, 21 Jan 2022 00:38:47 +0100
do not exit immediately but wait for a return when an error occurs
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/source/virusTestConsole/virusTestConsole.cpp b/source/virusTestConsole/virusTestConsole.cpp
@@ -197,10 +197,16 @@ int main(int _argc, char* _argv[])
periph.getEsai().setCallback(audioCallback,4,1);
periph.getEsai().writeEmptyAudioIn(4, 2);
+ auto waitReturn = []()
+ {
+ std::cin.ignore();
+ };
+
const auto romFile = findROM();
if(romFile.empty())
{
std::cout << "Unable to find ROM. Place a ROM file with .bin extension next to this program." << std::endl;
+ waitReturn();
return -1;
}
ROMFile v(romFile);
@@ -211,6 +217,7 @@ int main(int _argc, char* _argv[])
if(!loadSingle(v, _argv[1]))
{
std::cout << "Failed to find preset '" << _argv[1] << "', make sure to use a ROM that contains it" << std::endl;
+ waitReturn();
return -1;
}
}