More cleanups from clang-tidy.

This commit is contained in:
Stephen Anthony 2019-12-22 22:46:27 -03:30
parent 2944ee7564
commit 8bbabe3c5d
4 changed files with 20 additions and 7 deletions

View File

@ -85,8 +85,8 @@ void FBSurface::line(uInt32 x, uInt32 y, uInt32 x2, uInt32 y2, ColorId color)
// x is major axis
if(dx < 0)
{
uInt32 tx = x; x = x2; x2 = tx;
uInt32 ty = y; y = y2; y2 = ty;
std::swap(x, x2);
y = y2;
dx = -dx;
dy = -dy;
}
@ -110,8 +110,8 @@ void FBSurface::line(uInt32 x, uInt32 y, uInt32 x2, uInt32 y2, ColorId color)
// y is major axis
if(dy < 0)
{
uInt32 tx = x; x = x2; x2 = tx;
uInt32 ty = y; y = y2; y2 = ty;
x = x2;
std::swap(y, y2);
dx = -dx;
dy = -dy;
}

View File

@ -2420,7 +2420,7 @@ int Thumbulator::execute()
rb = inst & 0xFF;
DO_DISS(statusMsg << "swi 0x" << Base::HEX2 << rb << endl);
if((inst & 0xFF) == 0xCC)
if(rb == 0xCC)
{
write_register(0, cpsr);
return 0;

View File

@ -88,7 +88,7 @@ TIA::TIA(ConsoleIO& console, ConsoleTimingProvider timingProvider, Settings& set
myMissile1.setTIA(this);
myBall.setTIA(this);
reset();
initialize();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -128,7 +128,7 @@ void TIA::clearFrameManager()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::reset()
void TIA::initialize()
{
myHctr = 0;
myMovementInProgress = false;
@ -193,6 +193,14 @@ void TIA::reset()
#endif // DEBUGGER_SUPPORT
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::reset()
{
// Simply call initialize(); mostly to get around calling a virtual method
// from the constructor
initialize();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::install(System& system)
{

View File

@ -543,6 +543,11 @@ class TIA : public Device
string myFixedColorNames[7];
private:
/**
* Called to initialize all instance variables to known state.
*/
void initialize();
/**
* This callback is invoked by FrameManager when a new frame starts.
*/