MVC: Stay in title mode when valid file not found. (#1023)

This commit is contained in:
lodefmode 2024-04-04 12:48:32 -04:00 committed by GitHub
parent 8e8549c1c4
commit 98b2b9b1c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 3 deletions

View File

@ -58,12 +58,15 @@ class StreamReader : public Serializable
bool open(string_view path) { bool open(string_view path) {
myFile = Serializer(path, Serializer::Mode::ReadOnly); myFile = Serializer(path, Serializer::Mode::ReadOnly);
if(myFile) myFileSize = myFile ? myFile.size() : 0;
myFileSize = myFile.size();
return static_cast<bool>(myFile); return static_cast<bool>(myFile);
} }
bool isValid() {
return (myFileSize > 0) ? true:false;
}
void blankPartialLines(bool index) { void blankPartialLines(bool index) {
const int colorSize = myVisibleLines * 5; const int colorSize = myVisibleLines * 5;
if (index) if (index)
@ -1495,6 +1498,7 @@ bool MovieCart::process(uInt16 address)
switch(myTitleState) switch(myTitleState)
{ {
case TitleState::Display: case TitleState::Display:
if (myStream.isValid())
myTitleCycles++; myTitleCycles++;
if(myTitleCycles == TITLE_CYCLES) if(myTitleCycles == TITLE_CYCLES)
{ {