Enabled some more TIA stuff in the debugger.

This commit is contained in:
Stephen Anthony 2016-12-13 10:57:15 -03:30
parent b28dfaa31f
commit 7b0a82f04a
6 changed files with 29 additions and 99 deletions

View File

@ -320,7 +320,7 @@ bool TIADebug::priorityPF(int newVal)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::collision(int collID, int newVal)
bool TIADebug::collision(int collID)
{
#if 0 // FIXME
uInt32 mask = 1 << collID;
@ -712,7 +712,7 @@ uInt8 TIADebug::hmBL(int newVal)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::frameCount() const
{
return 0;// return myTIA.myFrameCounter;
return myTIA.myFrameManager.frameCount();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -730,19 +730,13 @@ int TIADebug::clocksThisLine() const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::vsync() const
{
#if 0 // FIXME
return (myTIA.myVSYNC & 2) == 2;
#endif
return 0;
return myTIA.myFrameManager.vsync();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::vblank() const
{
#if 0 // FIXME
return (myTIA.myVBLANK & 2) == 2;
#endif
return 0;
return myTIA.myFrameManager.vblank();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -121,21 +121,21 @@ class TIADebug : public DebuggerSystem
bool priorityPF(int newVal = -1);
// Collision registers
bool collM0_P1(int newVal = -1) { return collision(0, newVal); }
bool collM0_P0(int newVal = -1) { return collision(1, newVal); }
bool collM1_P0(int newVal = -1) { return collision(2, newVal); }
bool collM1_P1(int newVal = -1) { return collision(3, newVal); }
bool collP0_PF(int newVal = -1) { return collision(4, newVal); }
bool collP0_BL(int newVal = -1) { return collision(5, newVal); }
bool collP1_PF(int newVal = -1) { return collision(6, newVal); }
bool collP1_BL(int newVal = -1) { return collision(7, newVal); }
bool collM0_PF(int newVal = -1) { return collision(8, newVal); }
bool collM0_BL(int newVal = -1) { return collision(9, newVal); }
bool collM1_PF(int newVal = -1) { return collision(10, newVal); }
bool collM1_BL(int newVal = -1) { return collision(11, newVal); }
bool collBL_PF(int newVal = -1) { return collision(12, newVal); }
bool collP0_P1(int newVal = -1) { return collision(13, newVal); }
bool collM0_M1(int newVal = -1) { return collision(14, newVal); }
bool collM0_P1() { return collision(0); }
bool collM0_P0() { return collision(1); }
bool collM1_P0() { return collision(2); }
bool collM1_P1() { return collision(3); }
bool collP0_PF() { return collision(4); }
bool collP0_BL() { return collision(5); }
bool collP1_PF() { return collision(6); }
bool collP1_BL() { return collision(7); }
bool collM0_PF() { return collision(8); }
bool collM0_BL() { return collision(9); }
bool collM1_PF() { return collision(10); }
bool collM1_BL() { return collision(11); }
bool collBL_PF() { return collision(12); }
bool collP0_P1() { return collision(13); }
bool collM0_M1() { return collision(14); }
// TIA strobe registers
void strobeWsync() { mySystem.poke(WSYNC, 0); }
@ -162,8 +162,8 @@ class TIADebug : public DebuggerSystem
/** Display a color patch for color at given index in the palette */
string colorSwatch(uInt8 c);
/** Get/set specific bits in the collision register (used by collXX_XX) */
bool collision(int collID, int newVal);
/** Get specific bits in the collision register (used by collXX_XX) */
bool collision(int collID);
string audFreq(uInt8 div);
string booleanWithLabel(string label, bool value);

View File

@ -108,10 +108,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
"", kCheckActionCmd);
myCollision[idx]->setTarget(this);
myCollision[idx]->setID(idx);
// TODO - make collisions editable in TIA //
myCollision[idx]->setEditable(false);
// addFocusWidget(myCollision[idx]);
////////////////////////////////////////////
collX += myCollision[idx]->getWidth() + 10;
idx++;
@ -691,66 +688,6 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
case kCheckActionCmd:
switch(id)
{
case kP0_PFID:
tia.collP0_PF(myCollision[kP0_PFID]->getState() ? 1 : 0);
break;
case kP0_BLID:
tia.collP0_BL(myCollision[kP0_BLID]->getState() ? 1 : 0);
break;
case kP0_M1ID:
tia.collM1_P0(myCollision[kP0_M1ID]->getState() ? 1 : 0);
break;
case kP0_M0ID:
tia.collM0_P0(myCollision[kP0_M0ID]->getState() ? 1 : 0);
break;
case kP0_P1ID:
tia.collP0_P1(myCollision[kP0_P1ID]->getState() ? 1 : 0);
break;
case kP1_PFID:
tia.collP1_PF(myCollision[kP1_PFID]->getState() ? 1 : 0);
break;
case kP1_BLID:
tia.collP1_BL(myCollision[kP1_BLID]->getState() ? 1 : 0);
break;
case kP1_M1ID:
tia.collM1_P1(myCollision[kP1_M1ID]->getState() ? 1 : 0);
break;
case kP1_M0ID:
tia.collM0_P1(myCollision[kP1_M0ID]->getState() ? 1 : 0);
break;
case kM0_PFID:
tia.collM0_PF(myCollision[kM0_PFID]->getState() ? 1 : 0);
break;
case kM0_BLID:
tia.collM0_BL(myCollision[kM0_BLID]->getState() ? 1 : 0);
break;
case kM0_M1ID:
tia.collM0_M1(myCollision[kM0_M1ID]->getState() ? 1 : 0);
break;
case kM1_PFID:
tia.collM1_PF(myCollision[kM1_PFID]->getState() ? 1 : 0);
break;
case kM1_BLID:
tia.collM1_BL(myCollision[kM1_BLID]->getState() ? 1 : 0);
break;
case kBL_PFID:
tia.collBL_PF(myCollision[kBL_PFID]->getState() ? 1 : 0);
break;
case kRefP0ID:
tia.refP0(myRefP0->getState() ? 1 : 0);
break;

View File

@ -176,12 +176,6 @@ TvMode FrameManager::tvMode() const
return myMode;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FrameManager::vblank() const
{
return myVblank;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 FrameManager::height() const
{

View File

@ -51,7 +51,9 @@ class FrameManager : public Serializable
TvMode tvMode() const;
bool vblank() const;
bool vblank() const { return myVblank; }
bool vsync() const { return myVsync; }
uInt32 height() const;
@ -59,6 +61,8 @@ class FrameManager : public Serializable
uInt32 scanlines() const;
uInt32 frameCount() const { return myTotalFrames; }
/**
Serializable methods (see that class for more information).
*/

View File

@ -1242,5 +1242,6 @@ void TIA::updatePaddle(uInt8 idx)
throw runtime_error("invalid paddle index");
}
myPaddleReaders[idx].update(double(resistance) / MAX_RESISTANCE, myTimestamp, myFrameManager.tvMode());
myPaddleReaders[idx].update(double(resistance) / MAX_RESISTANCE,
myTimestamp, myFrameManager.tvMode());
}