Skip to content

Commit 4688ed4

Browse files
author
Steven Tattersall
committed
Bug fix: failed to launch if no user exception bits set.
GetRaw() can return non-zero values because Hatari can set the autostart bit. So check if we added any of our known flags, before adding extra cmd line arguments.
1 parent 1f320bc commit 4688ed4

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

tools/hrdb/models/launcher.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,26 @@ bool LaunchHatari(const LaunchSettings& settings, Session* pSession)
149149
}
150150

151151
// If there are autostart exceptions, generate the string
152-
if (settings.m_exceptionMask.GetRaw() != 0)
152+
// We have to check each bit manually, since the GetRaw() value
153+
// can have non-user bits set (like autostart)
154+
QString autoStartStr;
155+
QTextStream ref(&autoStartStr);
156+
bool first = true;
157+
for (uint32_t i = 0; i < ExceptionMask::kExceptionCount; ++i)
153158
{
154-
QString autoStartStr;
155-
QTextStream ref(&autoStartStr);
156-
bool first = true;
157-
for (uint32_t i = 0; i < ExceptionMask::kExceptionCount; ++i)
159+
ExceptionMask::Type t = (ExceptionMask::Type)i;
160+
if (settings.m_exceptionMask.Get(t))
158161
{
159-
ExceptionMask::Type t = (ExceptionMask::Type)i;
160-
if (settings.m_exceptionMask.Get(t))
161-
{
162-
if (!first)
163-
ref << ",";
164-
ref << QString(ExceptionMask::GetAutostartArg(t));
165-
first = false;
166-
}
162+
if (!first)
163+
ref << ",";
164+
ref << QString(ExceptionMask::GetAutostartArg(t));
165+
first = false;
167166
}
167+
}
168+
// Only add to command line if a bit was set
169+
if (!first)
170+
{
171+
// Found some flags
168172
ref << ",autostart";
169173
args.push_back("--debug-except");
170174
args.push_back(autoStartStr);

0 commit comments

Comments
 (0)