Expose GRPx read/write of new/old registers in debugger TIA tab.

This commit is contained in:
Stephen Anthony 2017-04-25 19:42:04 -02:30
parent 5212dc1189
commit f8d7253ec3
3 changed files with 50 additions and 24 deletions

View File

@ -53,8 +53,10 @@ const DebuggerState& TIADebug::getState()
// Player 1 & 2 graphics registers // Player 1 & 2 graphics registers
myState.gr.clear(); myState.gr.clear();
myState.gr.push_back(grP0()); myState.gr.push_back(myTIA.myPlayer0.getGRPNew());
myState.gr.push_back(grP1()); myState.gr.push_back(myTIA.myPlayer1.getGRPNew());
myState.gr.push_back(myTIA.myPlayer0.getGRPOld());
myState.gr.push_back(myTIA.myPlayer1.getGRPOld());
// Position registers // Position registers
myState.pos.clear(); myState.pos.clear();
@ -114,8 +116,10 @@ void TIADebug::saveOldState()
// Player 1 & 2 graphics registers // Player 1 & 2 graphics registers
myOldState.gr.clear(); myOldState.gr.clear();
myOldState.gr.push_back(grP0()); myOldState.gr.push_back(myTIA.myPlayer0.getGRPNew());
myOldState.gr.push_back(grP1()); myOldState.gr.push_back(myTIA.myPlayer1.getGRPNew());
myOldState.gr.push_back(myTIA.myPlayer0.getGRPOld());
myOldState.gr.push_back(myTIA.myPlayer1.getGRPOld());
// Position registers // Position registers
myOldState.pos.clear(); myOldState.pos.clear();
@ -658,6 +662,24 @@ uInt8 TIADebug::hmBL(int newVal)
return myTIA.registerValue(HMBL) >> 4; return myTIA.registerValue(HMBL) >> 4;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIADebug::setGRP0Old(uInt8 b)
{
myTIA.myPlayer0.setGRPOld(b);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIADebug::setGRP1Old(uInt8 b)
{
myTIA.myPlayer1.setGRPOld(b);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIADebug::setENABLOld(bool b)
{
myTIA.myBall.setENABLOld(b);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::frameCount() const int TIADebug::frameCount() const
{ {

View File

@ -104,6 +104,10 @@ class TIADebug : public DebuggerSystem
uInt8 audV0(int newVal = -1); uInt8 audV0(int newVal = -1);
uInt8 audV1(int newVal = -1); uInt8 audV1(int newVal = -1);
void setGRP0Old(uInt8 b);
void setGRP1Old(uInt8 b);
void setENABLOld(bool b);
// TIA bool registers // TIA bool registers
bool refP0(int newVal = -1); bool refP0(int newVal = -1);
bool refP1(int newVal = -1); bool refP1(int newVal = -1);

View File

@ -186,8 +186,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// posP0 // posP0
xpos += myGRP0->getWidth() + 12; xpos += myGRP0->getWidth() + 12;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 4*fontWidth, fontHeight,
"Pos #", kTextAlignLeft); "Pos#", kTextAlignLeft);
xpos += t->getWidth() + 2; xpos += t->getWidth() + 2;
myPosP0 = new DataGridWidget(boss, nfont, xpos, ypos, myPosP0 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 3, 8, Common::Base::F_10); 1, 1, 3, 8, Common::Base::F_10);
@ -197,7 +197,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
addFocusWidget(myPosP0); addFocusWidget(myPosP0);
// hmP0 // hmP0
xpos += myPosP0->getWidth() + 12; xpos += myPosP0->getWidth() + fontWidth + 12;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"HM", kTextAlignLeft); "HM", kTextAlignLeft);
xpos += 2*fontWidth + 5; xpos += 2*fontWidth + 5;
@ -242,7 +242,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
addFocusWidget(myNusizP0); addFocusWidget(myNusizP0);
xpos += myNusizP0->getWidth() + 5; xpos += myNusizP0->getWidth() + 5;
myNusizP0Text = new EditTextWidget(boss, nfont, xpos, ypos, 23*fontWidth, myNusizP0Text = new EditTextWidget(boss, nfont, xpos, ypos, 21*fontWidth,
lineHeight, ""); lineHeight, "");
myNusizP0Text->setEditable(false, true); myNusizP0Text->setEditable(false, true);
@ -261,8 +261,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// posP1 // posP1
xpos += myGRP1->getWidth() + 12; xpos += myGRP1->getWidth() + 12;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 4*fontWidth, fontHeight,
"Pos #", kTextAlignLeft); "Pos#", kTextAlignLeft);
xpos += t->getWidth() + 2; xpos += t->getWidth() + 2;
myPosP1 = new DataGridWidget(boss, nfont, xpos, ypos, myPosP1 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 3, 8, Common::Base::F_10); 1, 1, 3, 8, Common::Base::F_10);
@ -272,7 +272,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
addFocusWidget(myPosP1); addFocusWidget(myPosP1);
// hmP1 // hmP1
xpos += myPosP1->getWidth() + 12; xpos += myPosP1->getWidth() + fontWidth + 12;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"HM", kTextAlignLeft); "HM", kTextAlignLeft);
xpos += 2*fontWidth + 5; xpos += 2*fontWidth + 5;
@ -317,7 +317,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
addFocusWidget(myNusizP1); addFocusWidget(myNusizP1);
xpos += myNusizP1->getWidth() + 5; xpos += myNusizP1->getWidth() + 5;
myNusizP1Text = new EditTextWidget(boss, nfont, xpos, ypos, 23*fontWidth, myNusizP1Text = new EditTextWidget(boss, nfont, xpos, ypos, 21*fontWidth,
lineHeight, ""); lineHeight, "");
myNusizP1Text->setEditable(false, true); myNusizP1Text->setEditable(false, true);
@ -337,8 +337,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// posM0 // posM0
xpos += myEnaM0->getWidth() + 12; xpos += myEnaM0->getWidth() + 12;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 4*fontWidth, fontHeight,
"Pos #", kTextAlignLeft); "Pos#", kTextAlignLeft);
xpos += t->getWidth() + 2; xpos += t->getWidth() + 2;
myPosM0 = new DataGridWidget(boss, nfont, xpos, ypos, myPosM0 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 3, 8, Common::Base::F_10); 1, 1, 3, 8, Common::Base::F_10);
@ -393,8 +393,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// posM0 // posM0
xpos += myEnaM1->getWidth() + 12; xpos += myEnaM1->getWidth() + 12;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 4*fontWidth, fontHeight,
"Pos #", kTextAlignLeft); "Pos#", kTextAlignLeft);
xpos += t->getWidth() + 2; xpos += t->getWidth() + 2;
myPosM1 = new DataGridWidget(boss, nfont, xpos, ypos, myPosM1 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 3, 8, Common::Base::F_10); 1, 1, 3, 8, Common::Base::F_10);
@ -449,8 +449,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// posBL // posBL
xpos += myEnaBL->getWidth() + 12; xpos += myEnaBL->getWidth() + 12;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 4*fontWidth, fontHeight,
"Pos #", kTextAlignLeft); "Pos#", kTextAlignLeft);
xpos += t->getWidth() + 2; xpos += t->getWidth() + 2;
myPosBL = new DataGridWidget(boss, nfont, xpos, ypos, myPosBL = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 3, 8, Common::Base::F_10); 1, 1, 3, 8, Common::Base::F_10);
@ -721,7 +721,7 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
break; break;
case kGRP0OldID: case kGRP0OldID:
cerr << "GRP0Old\n"; tia.setGRP0Old(myGRP0Old->getIntState());
break; break;
case kGRP1ID: case kGRP1ID:
@ -729,7 +729,7 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
break; break;
case kGRP1OldID: case kGRP1OldID:
cerr << "GRP1Old\n"; tia.setGRP1Old(myGRP1Old->getIntState());
break; break;
case kPF0ID: case kPF0ID:
@ -847,10 +847,10 @@ void TiaWidget::loadConfig()
myGRP0->setBackgroundColor(-1); myGRP0->setBackgroundColor(-1);
myGRP0->setIntState(state.gr[P0], false); myGRP0->setIntState(state.gr[P0], false);
// grP0 (old) // FIXME - for now, same as 'new' // grP0 (old)
myGRP0Old->setColor(state.coluRegs[0]); myGRP0Old->setColor(state.coluRegs[0]);
myGRP0Old->setBackgroundColor(-1); myGRP0Old->setBackgroundColor(-1);
myGRP0Old->setIntState(state.gr[P0], false); myGRP0Old->setIntState(state.gr[P0+2], false);
// posP0 // posP0
myPosP0->setList(0, state.pos[P0], state.pos[P0] != oldstate.pos[P0]); myPosP0->setList(0, state.pos[P0], state.pos[P0] != oldstate.pos[P0]);
@ -875,10 +875,10 @@ void TiaWidget::loadConfig()
myGRP1->setBackgroundColor(-1); myGRP1->setBackgroundColor(-1);
myGRP1->setIntState(state.gr[P1], false); myGRP1->setIntState(state.gr[P1], false);
// grP1 (old) // FIXME - for now, same as 'new' // grP1 (old)
myGRP1Old->setColor(state.coluRegs[1]); myGRP1Old->setColor(state.coluRegs[1]);
myGRP1Old->setBackgroundColor(-1); myGRP1Old->setBackgroundColor(-1);
myGRP1Old->setIntState(state.gr[P1], false); myGRP1Old->setIntState(state.gr[P1+2], false);
// posP1 // posP1
myPosP1->setList(0, state.pos[P1], state.pos[P1] != oldstate.pos[P1]); myPosP1->setList(0, state.pos[P1], state.pos[P1] != oldstate.pos[P1]);