From c526d260a019a7a378ab3bc646b9ef2217d2f76d Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sun, 4 Dec 2016 14:48:17 -0330 Subject: [PATCH] Re-enable fixed debug colors. --- src/emucore/tia/core_6502ts/Background.cxx | 102 +++++++++++++++++++++ src/emucore/tia/core_6502ts/Background.hxx | 66 +++++++++++++ src/emucore/tia/core_6502ts/Ball.cxx | 28 +++++- src/emucore/tia/core_6502ts/Ball.hxx | 7 +- src/emucore/tia/core_6502ts/Missile.cxx | 34 ++++++- src/emucore/tia/core_6502ts/Missile.hxx | 6 ++ src/emucore/tia/core_6502ts/Player.cxx | 27 +++++- src/emucore/tia/core_6502ts/Player.hxx | 6 ++ src/emucore/tia/core_6502ts/Playfield.cxx | 52 +++++++---- src/emucore/tia/core_6502ts/Playfield.hxx | 7 +- src/emucore/tia/core_6502ts/TIA.cxx | 41 +++++++-- src/emucore/tia/core_6502ts/TIA.hxx | 22 ++++- src/emucore/tia/core_6502ts/module.mk | 1 + 13 files changed, 362 insertions(+), 37 deletions(-) create mode 100644 src/emucore/tia/core_6502ts/Background.cxx create mode 100644 src/emucore/tia/core_6502ts/Background.hxx diff --git a/src/emucore/tia/core_6502ts/Background.cxx b/src/emucore/tia/core_6502ts/Background.cxx new file mode 100644 index 000000000..74a66eb8b --- /dev/null +++ b/src/emucore/tia/core_6502ts/Background.cxx @@ -0,0 +1,102 @@ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2016 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id$ +//============================================================================ + +#include "Background.hxx" + +namespace TIA6502tsCore { + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Background::Background() +{ + reset(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Background::reset() +{ + myColor = myObjectColor = myDebugColor = 0; + myDebugEnabled = false; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Background::setColor(uInt8 color) +{ + myObjectColor = color; + applyColors(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Background::setDebugColor(uInt8 color) +{ + myDebugColor = color; + applyColors(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Background::enableDebugColors(bool enabled) +{ + myDebugEnabled = enabled; + applyColors(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Background::applyColors() +{ + myColor = myDebugEnabled ? myDebugColor : myObjectColor; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// TODO: implement this once the class is finalized +bool Background::save(Serializer& out) const +{ + try + { + out.putString(name()); + + // TODO - save instance variables + } + catch(...) + { + cerr << "ERROR: TIA_BK::save" << endl; + return false; + } + + return false; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// TODO: implement this once the class is finalized +bool Background::load(Serializer& in) +{ + try + { + if(in.getString() != name()) + return false; + + // TODO - load instance variables + } + catch(...) + { + cerr << "ERROR: TIA_BK::load" << endl; + return false; + } + + return false; +} + +} // namespace TIA6502tsCore diff --git a/src/emucore/tia/core_6502ts/Background.hxx b/src/emucore/tia/core_6502ts/Background.hxx new file mode 100644 index 000000000..803dd7f0c --- /dev/null +++ b/src/emucore/tia/core_6502ts/Background.hxx @@ -0,0 +1,66 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2016 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id$ +//============================================================================ + +#ifndef TIA_6502TS_CORE_BACKGROUND +#define TIA_6502TS_CORE_BACKGROUND + +#include "Serializable.hxx" +#include "bspf.hxx" + +namespace TIA6502tsCore { + +class Background : public Serializable +{ + public: + Background(); + + public: + void reset(); + + void setColor(uInt8 color); + void setDebugColor(uInt8 color); + void enableDebugColors(bool enabled); + + uInt8 getColor() const { return myColor; } + + /** + Serializable methods (see that class for more information). + */ + bool save(Serializer& out) const override; + bool load(Serializer& in) override; + string name() const override { return "TIA_BK"; } + + private: + void applyColors(); + + private: + uInt8 myColor; + uInt8 myObjectColor, myDebugColor; + bool myDebugEnabled; + + private: + Background(const Background&) = delete; + Background(Background&&) = delete; + Background& operator=(const Background&) = delete; + Background& operator=(Background&&); +}; + +} // namespace TIA6502tsCore + +#endif // TIA_6502TS_CORE_BACKGROUND diff --git a/src/emucore/tia/core_6502ts/Ball.cxx b/src/emucore/tia/core_6502ts/Ball.cxx index 7cdfc0de0..3b8e88aa7 100644 --- a/src/emucore/tia/core_6502ts/Ball.cxx +++ b/src/emucore/tia/core_6502ts/Ball.cxx @@ -36,7 +36,7 @@ Ball::Ball(uInt32 collisionMask) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Ball::reset() { - myColor = 0; + myColor = myObjectColor = myDebugColor = 0; collision = myCollisionMaskDisabled; myIsEnabledOld = false; myIsEnabledNew = false; @@ -47,9 +47,11 @@ void Ball::reset() myIsMoving = false; myWidth = 1; myIsRendering = false; + myDebugEnabled = false; myRenderCounter = 0; updateEnabled(); + applyColors(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -99,14 +101,28 @@ void Ball::toggleCollisions(bool enabled) void Ball::toggleEnabled(bool enabled) { myIsSuppressed = !enabled; - updateEnabled(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Ball::setColor(uInt8 color) { - myColor = color; + myObjectColor = color; + applyColors(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Ball::setDebugColor(uInt8 color) +{ + myDebugColor = color; + applyColors(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Ball::enableDebugColors(bool enabled) +{ + myDebugEnabled = enabled; + applyColors(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -163,6 +179,12 @@ void Ball::updateEnabled() myIsEnabled = !myIsSuppressed && (myIsDelaying ? myIsEnabledOld : myIsEnabledNew); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Ball::applyColors() +{ + myColor = myDebugEnabled ? myDebugColor : myObjectColor; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // TODO: implement this once the class is finalized bool Ball::save(Serializer& out) const diff --git a/src/emucore/tia/core_6502ts/Ball.hxx b/src/emucore/tia/core_6502ts/Ball.hxx index ad6e3cde9..d5e124c10 100644 --- a/src/emucore/tia/core_6502ts/Ball.hxx +++ b/src/emucore/tia/core_6502ts/Ball.hxx @@ -51,6 +51,9 @@ class Ball : public Serializable void setColor(uInt8 color); + void setDebugColor(uInt8 color); + void enableDebugColors(bool enabled); + void startMovement(); bool movementTick(uInt32 clock, bool apply); @@ -79,6 +82,7 @@ class Ball : public Serializable private: void updateEnabled(); + void applyColors(); private: @@ -86,6 +90,8 @@ class Ball : public Serializable uInt32 myCollisionMaskEnabled; uInt8 myColor; + uInt8 myObjectColor, myDebugColor; + bool myDebugEnabled; bool myIsEnabledOld; bool myIsEnabledNew; @@ -102,7 +108,6 @@ class Ball : public Serializable Int8 myRenderCounter; private: - Ball() = delete; Ball(const Ball&) = delete; Ball(Ball&&) = delete; diff --git a/src/emucore/tia/core_6502ts/Missile.cxx b/src/emucore/tia/core_6502ts/Missile.cxx index df2393f14..f624f6aac 100644 --- a/src/emucore/tia/core_6502ts/Missile.cxx +++ b/src/emucore/tia/core_6502ts/Missile.cxx @@ -48,7 +48,8 @@ void Missile::reset() myWidth = 1; myIsRendering = false; myRenderCounter = 0; - myColor = 0; + myColor = myObjectColor = myDebugColor = 0; + myDebugEnabled = false; collision = myCollisionMaskDisabled; updateEnabled(); @@ -78,11 +79,13 @@ void Missile::resmp(uInt8 value, const Player& player) { const uInt8 resmp = value & 0x02; - if (resmp == myResmp) return; + if (resmp == myResmp) + return; myResmp = resmp; - if (!myResmp) myCounter = player.getRespClock(); + if (!myResmp) + myCounter = player.getRespClock(); updateEnabled(); } @@ -155,13 +158,34 @@ void Missile::tick() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Missile::setColor(uInt8 color) { - myColor = color; + myObjectColor = color; + applyColors(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Missile::setDebugColor(uInt8 color) +{ + myDebugColor = color; + applyColors(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Missile::enableDebugColors(bool enabled) +{ + myDebugEnabled = enabled; + applyColors(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Missile::updateEnabled() { - myIsEnabled = !myIsSuppressed && myEnam && !myResmp; + myIsEnabled = !myIsSuppressed && myEnam && !myResmp; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Missile::applyColors() +{ + myColor = myDebugEnabled ? myDebugColor : myObjectColor; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/core_6502ts/Missile.hxx b/src/emucore/tia/core_6502ts/Missile.hxx index 4002ca4d6..7b9c753bc 100644 --- a/src/emucore/tia/core_6502ts/Missile.hxx +++ b/src/emucore/tia/core_6502ts/Missile.hxx @@ -55,6 +55,9 @@ class Missile : public Serializable void setColor(uInt8 color); + void setDebugColor(uInt8 color); + void enableDebugColors(bool enabled); + void toggleCollisions(bool enabled); void toggleEnabled(bool enabled); @@ -77,6 +80,7 @@ class Missile : public Serializable private: void updateEnabled(); + void applyColors(); private: @@ -99,6 +103,8 @@ class Missile : public Serializable const uInt8* myDecodes; uInt8 myColor; + uInt8 myObjectColor, myDebugColor; + bool myDebugEnabled; private: Missile(const Missile&) = delete; diff --git a/src/emucore/tia/core_6502ts/Player.cxx b/src/emucore/tia/core_6502ts/Player.cxx index 648f3cc44..e185e6f08 100644 --- a/src/emucore/tia/core_6502ts/Player.cxx +++ b/src/emucore/tia/core_6502ts/Player.cxx @@ -50,6 +50,8 @@ void Player::reset() myPattern = 0; myIsReflected = 0; myIsDelaying = false; + myColor = myObjectColor = myDebugColor = 0; + myDebugEnabled = false; collision = myCollisionMaskDisabled; updatePattern(); @@ -132,7 +134,22 @@ void Player::toggleCollisions(bool enabled) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Player::setColor(uInt8 color) { - myColor = color; + myObjectColor = color; + applyColors(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Player::setDebugColor(uInt8 color) +{ + myDebugColor = color; + applyColors(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Player::enableDebugColors(bool enabled) +{ + myDebugEnabled = enabled; + applyColors(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -214,7 +231,7 @@ void Player::updatePattern() if (myIsSuppressed) { myPattern = 0; return; -} + } const uInt32 pattern = myIsDelaying ? myPatternOld : myPatternNew; @@ -286,6 +303,12 @@ void Player::updatePattern() } } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Player::applyColors() +{ + myColor = myDebugEnabled ? myDebugColor : myObjectColor; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // TODO: implement this once the class is finalized bool Player::save(Serializer& out) const diff --git a/src/emucore/tia/core_6502ts/Player.hxx b/src/emucore/tia/core_6502ts/Player.hxx index 164c2a3d6..a6a33cc7a 100644 --- a/src/emucore/tia/core_6502ts/Player.hxx +++ b/src/emucore/tia/core_6502ts/Player.hxx @@ -52,6 +52,9 @@ class Player : public Serializable void setColor(uInt8 color); + void setDebugColor(uInt8 color); + void enableDebugColors(bool enabled); + void startMovement(); bool movementTick(uInt32 clock, bool apply); @@ -82,12 +85,15 @@ class Player : public Serializable private: void updatePattern(); + void applyColors(); private: uInt32 myCollisionMaskDisabled; uInt32 myCollisionMaskEnabled; uInt8 myColor; + uInt8 myObjectColor, myDebugColor; + bool myDebugEnabled; bool myIsSuppressed; diff --git a/src/emucore/tia/core_6502ts/Playfield.cxx b/src/emucore/tia/core_6502ts/Playfield.cxx index 7aa1f614a..f5681e5d0 100644 --- a/src/emucore/tia/core_6502ts/Playfield.cxx +++ b/src/emucore/tia/core_6502ts/Playfield.cxx @@ -41,10 +41,11 @@ void Playfield::reset() myPf1 = 0; myPf2 = 0; - myColor = 0; + myObjectColor = myDebugColor = 0; myColorP0 = 0; myColorP1 = 0; myColorMode = ColorMode::normal; + myDebugEnabled = false; collision = 0; @@ -66,12 +67,12 @@ void Playfield::pf1(uInt8 value) myPattern = (myPattern & 0x000FF00F) | ((value & 0x80) >> 3) | ((value & 0x40) >> 1) - | ((value & 0x20) << 1) - | ((value & 0x10) << 3) - | ((value & 0x08) << 5) - | ((value & 0x04) << 7) - | ((value & 0x02) << 9) - | ((value & 0x01) << 11); + | ((value & 0x20) << 1) + | ((value & 0x10) << 3) + | ((value & 0x08) << 5) + | ((value & 0x04) << 7) + | ((value & 0x02) << 9) + | ((value & 0x01) << 11); updatePattern(); } @@ -109,7 +110,7 @@ void Playfield::toggleCollisions(bool enabled) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Playfield::setColor(uInt8 color) { - myColor = color; + myObjectColor = color; applyColors(); } @@ -127,6 +128,20 @@ void Playfield::setColorP1(uInt8 color) applyColors(); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Playfield::setDebugColor(uInt8 color) +{ + myDebugColor = color; + applyColors(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Playfield::enableDebugColors(bool enabled) +{ + myDebugEnabled = enabled; + applyColors(); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Playfield::tick(uInt32 x) { @@ -154,16 +169,21 @@ void Playfield::tick(uInt32 x) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Playfield::applyColors() { - switch (myColorMode) + if (myDebugEnabled) + myColorLeft = myColorRight = myDebugColor; + else { - case ColorMode::normal: - myColorLeft = myColorRight = myColor; - break; + switch (myColorMode) + { + case ColorMode::normal: + myColorLeft = myColorRight = myObjectColor; + break; - case ColorMode::score: - myColorLeft = myColorP0; - myColorRight = myColorP1; - break; + case ColorMode::score: + myColorLeft = myColorP0; + myColorRight = myColorP1; + break; + } } } diff --git a/src/emucore/tia/core_6502ts/Playfield.hxx b/src/emucore/tia/core_6502ts/Playfield.hxx index 000e6240f..be299b3ed 100644 --- a/src/emucore/tia/core_6502ts/Playfield.hxx +++ b/src/emucore/tia/core_6502ts/Playfield.hxx @@ -52,6 +52,9 @@ class Playfield : public Serializable void setColorP1(uInt8 color); + void setDebugColor(uInt8 color); + void enableDebugColors(bool enabled); + void tick(uInt32 x); uInt8 getPixel(uInt8 colorIn) const { @@ -90,7 +93,9 @@ class Playfield : public Serializable uInt8 myColorRight; uInt8 myColorP0; uInt8 myColorP1; - uInt8 myColor; + uInt8 myObjectColor, myDebugColor; + bool myDebugEnabled; + ColorMode myColorMode; uInt32 myPattern; diff --git a/src/emucore/tia/core_6502ts/TIA.cxx b/src/emucore/tia/core_6502ts/TIA.cxx index 78ec0cd38..84019777b 100644 --- a/src/emucore/tia/core_6502ts/TIA.cxx +++ b/src/emucore/tia/core_6502ts/TIA.cxx @@ -97,11 +97,12 @@ void TIA::reset() myCollisionMask = 0; myLinesSinceChange = 0; myCollisionUpdateRequired = false; - myColorBk = 0; + myColorHBlank = 0; myLastCycle = 0; mySubClock = 0; + myBackground.reset(); myPlayfield.reset(); myMissile0.reset(); myMissile1.reset(); @@ -119,6 +120,8 @@ void TIA::reset() mySound.reset(); myDelayQueue.reset(); myFrameManager.reset(); + toggleFixedColors(0); // Turn off debug colours + frameReset(); // Recalculate the size of the display } @@ -128,7 +131,7 @@ void TIA::frameReset() // Clear frame buffers clearBuffers(); - // TODO - make use of ystart and height + // TODO - make use of ystart and height, maybe move to FrameManager } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -370,7 +373,7 @@ bool TIA::poke(uInt16 address, uInt8 value) case COLUBK: myLinesSinceChange = 0; - myColorBk = value & 0xFE; + myBackground.setColor(value & 0xFE); break; case COLUP0: @@ -724,10 +727,31 @@ bool TIA::toggleCollisions() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO: stub bool TIA::toggleFixedColors(uInt8 mode) { - return false; + // If mode is 0 or 1, use it as a boolean (off or on) + // Otherwise, flip the state + bool on = (mode == 0 || mode == 1) ? bool(mode) : myColorHBlank == 0; + + bool pal = isPAL(); + myMissile0.setDebugColor(pal ? M0ColorPAL : M0ColorNTSC); + myMissile1.setDebugColor(pal ? M1ColorPAL : M1ColorNTSC); + myPlayer0.setDebugColor(pal ? P0ColorPAL : P0ColorNTSC); + myPlayer1.setDebugColor(pal ? P1ColorPAL : P1ColorNTSC); + myBall.setDebugColor(pal ? BLColorPAL : BLColorNTSC); + myPlayfield.setDebugColor(pal ? PFColorPAL : PFColorNTSC); + myBackground.setDebugColor(pal ? BKColorPAL : BKColorNTSC); + + myMissile0.enableDebugColors(on); + myMissile1.enableDebugColors(on); + myPlayer0.enableDebugColors(on); + myPlayer1.enableDebugColors(on); + myBall.enableDebugColors(on); + myPlayfield.enableDebugColors(on); + myBackground.enableDebugColors(on); + myColorHBlank = on ? HBLANKColor : 0x00; + + return on; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -735,7 +759,7 @@ bool TIA::driveUnusedPinsRandom(uInt8 mode) { // If mode is 0 or 1, use it as a boolean (off or on) // Otherwise, return the state - if(mode == 0 || mode == 1) + if (mode == 0 || mode == 1) { myTIAPinsDriven = bool(mode); mySettings.setValue("tiadriven", myTIAPinsDriven); @@ -905,7 +929,7 @@ void TIA::updateCollision() void TIA::renderPixel(uInt32 x, uInt32 y, bool lineNotCached) { if (lineNotCached) { - uInt8 color = myColorBk; + uInt8 color = myBackground.getColor(); switch (myPriority) { @@ -959,7 +983,8 @@ void TIA::renderPixel(uInt32 x, uInt32 y, bool lineNotCached) void TIA::clearHmoveComb() { if (myFrameManager.isRendering() && myHstate == HState::blank) - memset(myCurrentFrameBuffer.get() + myFrameManager.currentLine() * 160, 0, 8); + memset(myCurrentFrameBuffer.get() + myFrameManager.currentLine() * 160, + myColorHBlank, 8); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/core_6502ts/TIA.hxx b/src/emucore/tia/core_6502ts/TIA.hxx index 6c4b0fc38..822c09a9a 100644 --- a/src/emucore/tia/core_6502ts/TIA.hxx +++ b/src/emucore/tia/core_6502ts/TIA.hxx @@ -27,6 +27,7 @@ #include "TIATypes.hxx" #include "DelayQueue.hxx" #include "FrameManager.hxx" +#include "Background.hxx" #include "Playfield.hxx" #include "Missile.hxx" #include "Player.hxx" @@ -179,6 +180,24 @@ class TIA : public AbstractTIA enum HState {blank, frame}; enum Priority {pfp, score, normal}; + enum FixedColors { + P0ColorNTSC = 0x30, + P1ColorNTSC = 0x16, + M0ColorNTSC = 0x38, + M1ColorNTSC = 0x12, + BLColorNTSC = 0x7e, + PFColorNTSC = 0x76, + BKColorNTSC = 0x0a, + P0ColorPAL = 0x62, + P1ColorPAL = 0x26, + M0ColorPAL = 0x68, + M1ColorPAL = 0x2e, + BLColorPAL = 0xde, + PFColorPAL = 0xd8, + BKColorPAL = 0x1c, + HBLANKColor = 0x0e + }; + private: void updateEmulation(); @@ -245,7 +264,7 @@ class TIA : public AbstractTIA uInt8 mySpriteEnabledBits; uInt8 myCollisionsEnabledBits; - uInt8 myColorBk; + uInt8 myColorHBlank; double myTimestamp; @@ -253,6 +272,7 @@ class TIA : public AbstractTIA BytePtr myCurrentFrameBuffer; BytePtr myPreviousFrameBuffer; + Background myBackground; Playfield myPlayfield; Missile myMissile0; Missile myMissile1; diff --git a/src/emucore/tia/core_6502ts/module.mk b/src/emucore/tia/core_6502ts/module.mk index 2e061d241..630bb0bf8 100644 --- a/src/emucore/tia/core_6502ts/module.mk +++ b/src/emucore/tia/core_6502ts/module.mk @@ -10,6 +10,7 @@ MODULE_OBJS := \ src/emucore/tia/core_6502ts/Missile.o \ src/emucore/tia/core_6502ts/Player.o \ src/emucore/tia/core_6502ts/Ball.o \ + src/emucore/tia/core_6502ts/Background.o \ src/emucore/tia/core_6502ts/LatchedInput.o \ src/emucore/tia/core_6502ts/PaddleReader.o