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) {
myFile = Serializer(path, Serializer::Mode::ReadOnly);
if(myFile)
myFileSize = myFile.size();
myFileSize = myFile ? myFile.size() : 0;
return static_cast<bool>(myFile);
}
bool isValid() {
return (myFileSize > 0) ? true:false;
}
void blankPartialLines(bool index) {
const int colorSize = myVisibleLines * 5;
if (index)
@ -1495,7 +1498,8 @@ bool MovieCart::process(uInt16 address)
switch(myTitleState)
{
case TitleState::Display:
myTitleCycles++;
if (myStream.isValid())
myTitleCycles++;
if(myTitleCycles == TITLE_CYCLES)
{
stopTitleScreen();