First pass to get debugger stuff working for TIA display.

This commit is contained in:
Stephen Anthony 2017-01-14 21:39:45 -03:30
parent c0aa5c83f5
commit 42122c3465
2 changed files with 28 additions and 55 deletions

View File

@ -665,10 +665,9 @@ void TIA::enableColorLoss(bool enabled)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// TODO: stub
uInt32 TIA::clocksThisLine() const uInt32 TIA::clocksThisLine() const
{ {
return 0; return myHctr + myXDelta;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -684,11 +683,31 @@ bool TIA::partialFrame() const
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// TODO: stub
bool TIA::scanlinePos(uInt16& x, uInt16& y) const bool TIA::scanlinePos(uInt16& x, uInt16& y) const
{ {
if(partialFrame())
{
// We only care about the scanline position when it's in the viewable area
if(1)//myFramePointerClocks >= myFramePointerOffset)
{
x = clocksThisLine();//(myFramePointerClocks - myFramePointerOffset) % 160;
y = scanlines();//(myFramePointerClocks - myFramePointerOffset) / 160;
return true;
}
else
{
x = 0;
y = 0;
return false; return false;
} }
}
else
{
x = width();
y = height();
return false;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIA::toggleBit(TIABit b, uInt8 mode) bool TIA::toggleBit(TIABit b, uInt8 mode)
@ -822,78 +841,34 @@ void TIA::setJitterRecoveryFactor(Int32 f)
{ {
} }
#ifdef DEBUGGER_SUPPORT
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::updateScanline() void TIA::updateScanline()
{ {
#if 0 // FIXME #if 0
// 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 totalClocks = (mySystem->cycles() * 3) - myClockWhenFrameStarted;
int endClock = ((totalClocks + 228) / 228) * 228; int endClock = ((totalClocks + 228) / 228) * 228;
int clock;
do { do {
mySystem->m6502().execute(1); updateScanlineByStep();
clock = mySystem->cycles() * 3; } while((mySystem->cycles() * 3) < endClock);
updateFrame(clock);
} while(clock < endClock);
// if we finished the frame, get ready for the next one
if(!myPartialFrameFlag)
endFrame();
#endif #endif
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::updateScanlineByStep() 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 // Update frame by one CPU instruction/color clock
mySystem->m6502().execute(1); mySystem->m6502().execute(1);
updateFrame(mySystem->cycles() * 3); updateEmulation();
// if we finished the frame, get ready for the next one
if(!myPartialFrameFlag)
endFrame();
#endif
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::updateScanlineByTrace(int target) 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) while(mySystem->m6502().getPC() != target)
{ updateScanlineByStep();
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() void TIA::updateEmulation()
{ {

View File

@ -285,7 +285,6 @@ class TIA : public Device
// Clear both internal TIA buffers to black (palette color 0) // Clear both internal TIA buffers to black (palette color 0)
void clearBuffers(); void clearBuffers();
#ifdef DEBUGGER_SUPPORT
/** /**
This method should be called to update the TIA with a new scanline. This method should be called to update the TIA with a new scanline.
*/ */
@ -302,7 +301,6 @@ class TIA : public Device
scanline by tracing to target address. scanline by tracing to target address.
*/ */
void updateScanlineByTrace(int target); void updateScanlineByTrace(int target);
#endif
/** /**
Save the current state of this device to the given Serializer. Save the current state of this device to the given Serializer.