Re-enable compilation with DEBUGGER_SUPPORT. The TIA stuff in the

debugger is currently broken, but at least the code compiles (needed
for the Windows and OSX test releases, as they aren't set up to be
compiled without the debugger.
This commit is contained in:
Stephen Anthony 2016-12-04 16:05:21 -03:30
parent 0de35eab7e
commit b9630f5e2a
10 changed files with 254 additions and 13 deletions

2
configure vendored
View File

@ -20,7 +20,7 @@ _zlib=auto
# default option behaviour yes/no
_build_windowed=yes
_build_sound=yes
_build_debugger=false
_build_debugger=yes
_build_joystick=yes
_build_cheats=yes
_build_thumb=yes

View File

@ -37,7 +37,7 @@
#include "System.hxx"
#include "M6502.hxx"
#include "Cart.hxx"
#include "TIA.hxx"
#include "AbstractTIA.hxx"
#include "CartDebug.hxx"
#include "CartDebugWidget.hxx"

View File

@ -20,7 +20,7 @@
#include <sstream>
#include "System.hxx"
#include "TIA.hxx"
#include "AbstractTIA.hxx"
#include "Debugger.hxx"
#include "Switches.hxx"
@ -153,9 +153,9 @@ uInt8 RiotDebug::inpt(int x)
bool RiotDebug::vblank(int bit)
{
if(bit == 6) // latches
return mySystem.tia().myVBLANK & 0x40;
return 0;//FIXME mySystem.tia().myVBLANK & 0x40;
else if(bit == 7) // dump to ground
return mySystem.tia().myDumpEnabled;
return 0;//FIXME mySystem.tia().myDumpEnabled;
else
return true;
}

View File

@ -20,7 +20,7 @@
#include "Base.hxx"
#include "System.hxx"
#include "Debugger.hxx"
#include "TIA.hxx"
#include "AbstractTIA.hxx"
#include "TIADebug.hxx"
@ -188,96 +188,127 @@ void TIADebug::saveOldState()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::vdelP0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(VDELP0, bool(newVal));
return myTIA.myVDELP0;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::vdelP1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(VDELP1, bool(newVal));
return myTIA.myVDELP1;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::vdelBL(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(VDELBL, bool(newVal));
return myTIA.myVDELBL;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::enaM0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(ENAM0, bool(newVal) << 1);
return myTIA.myENAM0;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::enaM1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(ENAM1, bool(newVal) << 1);
return myTIA.myENAM1;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::enaBL(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(ENABL, bool(newVal) << 1);
return myTIA.myENABL;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::resMP0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(RESMP0, bool(newVal) << 1);
return myTIA.myRESMP0;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::resMP1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(RESMP1, bool(newVal) << 1);
return myTIA.myRESMP1;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::refP0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(REFP0, bool(newVal) << 3);
return myTIA.myREFP0;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::refP1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(REFP1, bool(newVal) << 3);
return myTIA.myREFP1;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::refPF(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
{
int tmp = myTIA.myCTRLPF;
@ -289,11 +320,14 @@ bool TIADebug::refPF(int newVal)
}
return myTIA.myCTRLPF & 0x01;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::scorePF(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
{
int tmp = myTIA.myCTRLPF;
@ -305,11 +339,14 @@ bool TIADebug::scorePF(int newVal)
}
return myTIA.myCTRLPF & 0x02;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::priorityPF(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
{
int tmp = myTIA.myCTRLPF;
@ -321,11 +358,14 @@ bool TIADebug::priorityPF(int newVal)
}
return myTIA.myCTRLPF & 0x04;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::collision(int collID, int newVal)
{
#if 0 // FIXME
uInt32 mask = 1 << collID;
if(newVal > -1)
@ -337,146 +377,194 @@ bool TIADebug::collision(int collID, int newVal)
}
return myTIA.myCollision & mask;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::audC0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(AUDC0, newVal);
return myTIA.myAUDC0;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::audC1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(AUDC1, newVal);
return myTIA.myAUDC1;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::audV0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(AUDV0, newVal);
return myTIA.myAUDV0;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::audV1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(AUDV1, newVal);
return myTIA.myAUDV1;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::audF0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(AUDF0, newVal);
return myTIA.myAUDF0;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::audF1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(AUDF1, newVal);
return myTIA.myAUDF1;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::pf0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(PF0, newVal << 4);
return myTIA.myPF & 0x0f;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::pf1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(PF1, newVal);
return (myTIA.myPF & 0xff0) >> 4;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::pf2(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(PF2, newVal);
return (myTIA.myPF & 0xff000) >> 12;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::coluP0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(COLUP0, newVal);
return myTIA.myColor[P0Color] & 0xff;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::coluP1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(COLUP1, newVal);
return myTIA.myColor[P1Color] & 0xff;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::coluPF(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(COLUPF, newVal);
return myTIA.myColor[PFColor] & 0xff;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::coluBK(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(COLUBK, newVal);
return myTIA.myColor[BKColor] & 0xff;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::nusiz0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(NUSIZ0, newVal);
return myTIA.myNUSIZ0;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::nusiz1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(NUSIZ1, newVal);
return myTIA.myNUSIZ1;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::nusizP0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
{
uInt8 tmp = myTIA.myNUSIZ0 & ~0x07;
@ -485,11 +573,14 @@ uInt8 TIADebug::nusizP0(int newVal)
}
return myTIA.myNUSIZ0 & 0x07;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::nusizP1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
{
uInt8 tmp = myTIA.myNUSIZ1 & ~0x07;
@ -498,11 +589,14 @@ uInt8 TIADebug::nusizP1(int newVal)
}
return myTIA.myNUSIZ1 & 0x07;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::nusizM0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
{
uInt8 tmp = myTIA.myNUSIZ0 & ~0x30;
@ -511,11 +605,14 @@ uInt8 TIADebug::nusizM0(int newVal)
}
return (myTIA.myNUSIZ0 & 0x30) >> 4;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::nusizM1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
{
uInt8 tmp = myTIA.myNUSIZ1 & ~0x30;
@ -524,83 +621,110 @@ uInt8 TIADebug::nusizM1(int newVal)
}
return (myTIA.myNUSIZ1 & 0x30) >> 4;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::grP0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(GRP0, newVal);
return myTIA.myGRP0;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::grP1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(GRP1, newVal);
return myTIA.myGRP1;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::posP0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
myTIA.myPOSP0 = newVal;
return myTIA.myPOSP0;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::posP1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
myTIA.myPOSP1 = newVal;
return myTIA.myPOSP1;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::posM0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
myTIA.myPOSM0 = newVal;
return myTIA.myPOSM0;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::posM1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
myTIA.myPOSM1 = newVal;
return myTIA.myPOSM1;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::posBL(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
myTIA.myPOSBL = newVal;
return myTIA.myPOSBL;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::ctrlPF(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(CTRLPF, newVal);
return myTIA.myCTRLPF;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::sizeBL(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
{
uInt8 tmp = myTIA.myCTRLPF & ~0x30;
@ -609,57 +733,74 @@ uInt8 TIADebug::sizeBL(int newVal)
}
return (myTIA.myCTRLPF & 0x30) >> 4;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::hmP0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(HMP0, newVal << 4);
return myTIA.myHMP0 >> 4;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::hmP1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(HMP1, newVal << 4);
return myTIA.myHMP1 >> 4;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::hmM0(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(HMM0, newVal << 4);
return myTIA.myHMM0 >> 4;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::hmM1(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(HMM1, newVal << 4);
return myTIA.myHMM1 >> 4;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 TIADebug::hmBL(int newVal)
{
#if 0 // FIXME
if(newVal > -1)
mySystem.poke(HMBL, newVal << 4);
return myTIA.myHMBL >> 4;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::frameCount() const
{
return myTIA.myFrameCounter;
return 0;// return myTIA.myFrameCounter;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -677,13 +818,19 @@ int TIADebug::clocksThisLine() const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::vsync() const
{
#if 0 // FIXME
return (myTIA.myVSYNC & 2) == 2;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::vblank() const
{
#if 0 // FIXME
return (myTIA.myVBLANK & 2) == 2;
#endif
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -736,6 +883,7 @@ string TIADebug::booleanWithLabel(string label, bool value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string TIADebug::toString()
{
#if 0 // FIXME
ostringstream buf;
buf << "00: ";
@ -848,4 +996,6 @@ string TIADebug::toString()
;
// note: last line should not contain \n, caller will add.
return buf.str();
#endif
return "TODO";
}

View File

@ -22,7 +22,7 @@
class Debugger;
class TiaDebug;
class TIA;
class AbstractTIA;
#include "DebuggerSystem.hxx"
@ -52,7 +52,7 @@ class TIADebug : public DebuggerSystem
{
public:
TIADebug(Debugger& dbg, Console& console);
TIA& tia() const { return myTIA; }
AbstractTIA& tia() const { return myTIA; }
const DebuggerState& getState() override;
const DebuggerState& getOldState() override { return myOldState; }
@ -172,7 +172,7 @@ class TIADebug : public DebuggerSystem
TiaState myState;
TiaState myOldState;
TIA& myTIA;
AbstractTIA& myTIA;
string nusizStrings[8];

View File

@ -29,7 +29,7 @@
#include "DebuggerParser.hxx"
#include "TIADebug.hxx"
#include "TIASurface.hxx"
#include "TIA.hxx"
#include "AbstractTIA.hxx"
#include "TiaOutputWidget.hxx"

View File

@ -24,7 +24,7 @@
#include "GuiObject.hxx"
#include "OSystem.hxx"
#include "CartDebug.hxx"
#include "TIA.hxx"
#include "AbstractTIA.hxx"
#include "TIADebug.hxx"
#include "ToggleBitWidget.hxx"
#include "TogglePixelWidget.hxx"

View File

@ -19,7 +19,7 @@
#include "OSystem.hxx"
#include "Console.hxx"
#include "TIA.hxx"
#include "AbstractTIA.hxx"
#include "FrameBuffer.hxx"
#include "Widget.hxx"
#include "GuiObject.hxx"

View File

@ -780,6 +780,78 @@ void TIA::setJitterRecoveryFactor(Int32 f)
{
}
#ifdef DEBUGGER_SUPPORT
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::updateScanline()
{
#if 0 // FIXME
// Start a new frame if the old one was finished
if(!myPartialFrameFlag)
startFrame();
myPartialFrameFlag = true; // true either way
int totalClocks = (mySystem->cycles() * 3) - myClockWhenFrameStarted;
int endClock = ((totalClocks + 228) / 228) * 228;
int clock;
do {
mySystem->m6502().execute(1);
clock = mySystem->cycles() * 3;
updateFrame(clock);
} while(clock < endClock);
// if we finished the frame, get ready for the next one
if(!myPartialFrameFlag)
endFrame();
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::updateScanlineByStep()
{
#if 0 // FIXME
// Start a new frame if the old one was finished
if(!myPartialFrameFlag)
startFrame();
// true either way:
myPartialFrameFlag = true;
// Update frame by one CPU instruction/color clock
mySystem->m6502().execute(1);
updateFrame(mySystem->cycles() * 3);
// if we finished the frame, get ready for the next one
if(!myPartialFrameFlag)
endFrame();
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::updateScanlineByTrace(int target)
{
#if 0 // FIXME
// Start a new frame if the old one was finished
if(!myPartialFrameFlag)
startFrame();
// true either way:
myPartialFrameFlag = true;
while(mySystem->m6502().getPC() != target)
{
mySystem->m6502().execute(1);
updateFrame(mySystem->cycles() * 3);
}
// if we finished the frame, get ready for the next one
if(!myPartialFrameFlag)
endFrame();
#endif
}
#endif
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::updateEmulation()
{

View File

@ -153,6 +153,25 @@ class TIA : public AbstractTIA
// Clear both internal TIA buffers to black (palette color 0)
void clearBuffers();
#ifdef DEBUGGER_SUPPORT
/**
This method should be called to update the TIA with a new scanline.
*/
void updateScanline() override;
/**
This method should be called to update the TIA with a new partial
scanline by stepping one CPU instruction.
*/
void updateScanlineByStep() override;
/**
This method should be called to update the TIA with a new partial
scanline by tracing to target address.
*/
void updateScanlineByTrace(int target) override;
#endif
/**
Save the current state of this device to the given Serializer.