Skip to content

Commit

Permalink
Re-enable viewing TIA sound output in the debugger.
Browse files Browse the repository at this point in the history
This code is only temporary, until we more properly deal with it
in the new sound core.
  • Loading branch information
sa666666 committed Mar 24, 2017
1 parent 7a0f322 commit 90aa152
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
18 changes: 0 additions & 18 deletions src/debugger/TIADebug.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -344,73 +344,55 @@ bool TIADebug::collision(CollisionBit id) const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
26 changes: 23 additions & 3 deletions src/emucore/tia/TIA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,16 @@ void TIA::reset()
myFrameManager.reset();
toggleFixedColors(0); // Turn off debug colours

// FIXME - rework this when we add the new sound core
myAUDV0 = myAUDV1 = myAUDF0 = myAUDF1 = myAUDC0 = myAUDC1 = 0;

frameReset(); // Recalculate the size of the display
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::frameReset()
{
// Clear frame buffers
clearBuffers();

myAutoFrameEnabled = (mySettings.getInt("framerate") <= 0);
}

Expand Down Expand Up @@ -215,7 +216,7 @@ bool TIA::save(Serializer& out) const
if(!myInput1.save(out)) return false;

// Save the sound sample stuff ...
mySound.save(out);
if(!mySound.save(out)) return false;
}
catch(...)
{
Expand Down Expand Up @@ -392,14 +393,33 @@ bool TIA::poke(uInt16 address, uInt8 value)

break;

////////////////////////////////////////////////////////////
// FIXME - rework this when we add the new sound core
case AUDV0:
myAUDV0 = value & 0x0f;
mySound.set(address, value, mySystem->cycles());
break;
case AUDV1:
myAUDV1 = value & 0x0f;
mySound.set(address, value, mySystem->cycles());
break;
case AUDF0:
myAUDF0 = value & 0x1f;
mySound.set(address, value, mySystem->cycles());
break;
case AUDF1:
myAUDF1 = value & 0x1f;
mySound.set(address, value, mySystem->cycles());
break;
case AUDC0:
myAUDC0 = value & 0x0f;
mySound.set(address, value, mySystem->cycles());
break;
case AUDC1:
myAUDC1 = value & 0x0f;
mySound.set(address, value, mySystem->cycles());
break;
////////////////////////////////////////////////////////////

case HMOVE:
myDelayQueue.push(HMOVE, value, Delay::hmove);
Expand Down
5 changes: 5 additions & 0 deletions src/emucore/tia/TIA.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ class TIA : public Device
LatchedInput myInput0;
LatchedInput myInput1;

//////////////////////////////////////////////////////////////
// Audio values; only used by TIADebug
// FIXME - remove this when the new sound core is implemented
uInt8 myAUDV0, myAUDV1, myAUDC0, myAUDC1, myAUDF0, myAUDF1;

private:
TIA() = delete;
TIA(const TIA&) = delete;
Expand Down

0 comments on commit 90aa152

Please sign in to comment.