Clear fatal error flag on enetering the CPU main loop; code beautification.

This commit is contained in:
Christian Speckner 2018-12-05 00:00:01 +01:00
parent f08ba16acb
commit b58d843732
3 changed files with 5 additions and 9 deletions

View File

@ -17,12 +17,6 @@
#include "DispatchResult.hxx" #include "DispatchResult.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DispatchResult::assertStatus(Status status) const
{
if (myStatus != status) throw runtime_error("invalid status for operation");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool DispatchResult::isSuccess() const bool DispatchResult::isSuccess() const
{ {

View File

@ -52,7 +52,10 @@ class DispatchResult
private: private:
void assertStatus(Status status) const; void assertStatus(Status status) const
{
if (myStatus != status) throw runtime_error("invalid status for operation");
}
template<class ...Ts> void assertStatus(Status status, Ts... more) const template<class ...Ts> void assertStatus(Status status, Ts... more) const
{ {

View File

@ -245,8 +245,7 @@ bool M6502::execute(uInt64 number)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
inline void M6502::_execute(uInt64 cycles, DispatchResult& result) inline void M6502::_execute(uInt64 cycles, DispatchResult& result)
{ {
// Clear all of the execution status bits except for the fatal error bit myExecutionStatus = 0;
myExecutionStatus &= FatalErrorBit;
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
TIA& tia = mySystem->tia(); TIA& tia = mySystem->tia();