diff --git a/src/debugger/TIADebug.cxx b/src/debugger/TIADebug.cxx index b5b1a193f..4e0db44b5 100644 --- a/src/debugger/TIADebug.cxx +++ b/src/debugger/TIADebug.cxx @@ -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; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index c9385dab8..dab9ddbfc 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -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); } @@ -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(...) { @@ -392,14 +393,33 @@ bool TIA::poke(uInt16 address, uInt8 value) break; + //////////////////////////////////////////////////////////// + // FIXME - rework this when we add the new sound core case AUDV0: - case AUDV1: - case AUDF0: - case AUDF1: - case AUDC0: - case AUDC1: + 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); diff --git a/src/emucore/tia/TIA.hxx b/src/emucore/tia/TIA.hxx index 57717c2c7..85f008916 100644 --- a/src/emucore/tia/TIA.hxx +++ b/src/emucore/tia/TIA.hxx @@ -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;