TIA objects and collisions are now toggle with the Alt-period keys,

instead of having different keys to turn them on and off separately.
This brings the functionality in line with the rest of the objects/
collision key-combos, which were also toggle-only.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2449 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2012-04-20 21:32:24 +00:00
parent 6737091149
commit e3ba9f0ec2
7 changed files with 71 additions and 62 deletions

View File

@ -36,6 +36,10 @@
- 'Juno First' ROMs now use an AtariVox/SaveKey when possible - 'Juno First' ROMs now use an AtariVox/SaveKey when possible
- 'Astroblast' ROMs now use the paddles by default - 'Astroblast' ROMs now use the paddles by default
* Changed key-combo for enabling TIA objects and collisions to be
toggled on and off with the Alt-period and Shift-Alt-period (instead
of having two separate keys to turn them on and off).
* Updated included PNG library to latest stable version. * Updated included PNG library to latest stable version.
-Have fun! -Have fun!

View File

@ -1419,28 +1419,16 @@
</tr> </tr>
<tr> <tr>
<td>Turn all TIA objects off</td> <td>Toggle all TIA objects</td>
<td>Alt + .</td> <td>Alt + .</td>
<td>Cmd + .</td> <td>Cmd + .</td>
</tr> </tr>
<tr> <tr>
<td>Turn all TIA objects on</td> <td>Toggle all TIA collisions</td>
<td>Alt + /</td>
<td>Cmd + /</td>
</tr>
<tr>
<td>Turn all TIA collisions off</td>
<td>Shift-Alt + .</td> <td>Shift-Alt + .</td>
<td>Shift-Cmd + .</td> <td>Shift-Cmd + .</td>
</tr> </tr>
<tr>
<td>Turn all TIA collisions on</td>
<td>Shift-Alt + /</td>
<td>Shift-Cmd + /</td>
</tr>
</table> </table>
<p><b>Other Keys (cannot be remapped, except those marked with '*')</b></p> <p><b>Other Keys (cannot be remapped, except those marked with '*')</b></p>

View File

@ -894,6 +894,14 @@ void Console::toggleTIABit(TIABit bit, const string& bitname, bool show) const
myOSystem->frameBuffer().showMessage(message); myOSystem->frameBuffer().showMessage(message);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::toggleBits() const
{
bool enabled = myTIA->toggleBits();
string message = string("TIA bits") + (enabled ? " enabled" : " disabled");
myOSystem->frameBuffer().showMessage(message);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::toggleTIACollision(TIABit bit, const string& bitname, bool show) const void Console::toggleTIACollision(TIABit bit, const string& bitname, bool show) const
{ {
@ -902,6 +910,14 @@ void Console::toggleTIACollision(TIABit bit, const string& bitname, bool show) c
myOSystem->frameBuffer().showMessage(message); myOSystem->frameBuffer().showMessage(message);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::toggleCollisions() const
{
bool enabled = myTIA->toggleCollisions();
string message = string("TIA collisions") + (enabled ? " enabled" : " disabled");
myOSystem->frameBuffer().showMessage(message);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::toggleHMOVE() const void Console::toggleHMOVE() const
{ {
@ -911,22 +927,6 @@ void Console::toggleHMOVE() const
myOSystem->frameBuffer().showMessage("HMOVE blanking disabled"); myOSystem->frameBuffer().showMessage("HMOVE blanking disabled");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::enableBits(bool enable) const
{
myTIA->enableBits(enable);
string message = string("TIA bits") + (enable ? " enabled" : " disabled");
myOSystem->frameBuffer().showMessage(message);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::enableCollisions(bool enable) const
{
myTIA->enableCollisions(enable);
string message = string("TIA collisions") + (enable ? " enabled" : " disabled");
myOSystem->frameBuffer().showMessage(message);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::toggleFixedColors() const void Console::toggleFixedColors() const
{ {

View File

@ -270,7 +270,7 @@ class Console : public Serializable
void toggleBLBit() const { toggleTIABit(BLBit, "BL"); } void toggleBLBit() const { toggleTIABit(BLBit, "BL"); }
void togglePFBit() const { toggleTIABit(PFBit, "PF"); } void togglePFBit() const { toggleTIABit(PFBit, "PF"); }
void toggleHMOVE() const; void toggleHMOVE() const;
void enableBits(bool enable) const; void toggleBits() const;
/** /**
Toggles the TIA collisions specified in the method name. Toggles the TIA collisions specified in the method name.
@ -281,7 +281,7 @@ class Console : public Serializable
void toggleM1Collision() const { toggleTIACollision(M1Bit, "M1"); } void toggleM1Collision() const { toggleTIACollision(M1Bit, "M1"); }
void toggleBLCollision() const { toggleTIACollision(BLBit, "BL"); } void toggleBLCollision() const { toggleTIACollision(BLBit, "BL"); }
void togglePFCollision() const { toggleTIACollision(PFBit, "PF"); } void togglePFCollision() const { toggleTIACollision(PFBit, "PF"); }
void enableCollisions(bool enable) const; void toggleCollisions() const;
/** /**
Toggles the TIA 'fixed debug colors' mode. Toggles the TIA 'fixed debug colors' mode.
@ -339,11 +339,11 @@ class Console : public Serializable
System* mySystem; System* mySystem;
// Pointer to the Cartridge (the debugger needs it) // Pointer to the Cartridge (the debugger needs it)
Cartridge *myCart; Cartridge* myCart;
// Pointer to the 6532 (aka RIOT) (the debugger needs it) // Pointer to the 6532 (aka RIOT) (the debugger needs it)
// A RIOT of my own! (...with apologies to The Clash...) // A RIOT of my own! (...with apologies to The Clash...)
M6532 *myRiot; M6532* myRiot;
// Pointer to CompuMate handler (only used in CompuMate ROMs) // Pointer to CompuMate handler (only used in CompuMate ROMs)
CompuMate* myCMHandler; CompuMate* myCMHandler;

View File

@ -434,16 +434,9 @@ void EventHandler::poll(uInt64 time)
case KBDK_PERIOD: case KBDK_PERIOD:
if(mod & KMOD_SHIFT) if(mod & KMOD_SHIFT)
myOSystem->console().enableCollisions(false); myOSystem->console().toggleCollisions();
else else
myOSystem->console().enableBits(false); myOSystem->console().toggleBits();
break;
case KBDK_SLASH:
if(mod & KMOD_SHIFT)
myOSystem->console().enableCollisions(true);
else
myOSystem->console().enableBits(true);
break; break;
case KBDK_p: // Alt-p toggles phosphor effect case KBDK_p: // Alt-p toggles phosphor effect

View File

@ -54,7 +54,10 @@ TIA::TIA(Console& console, Sound& sound, Settings& settings)
myColorLossEnabled(false), myColorLossEnabled(false),
myPartialFrameFlag(false), myPartialFrameFlag(false),
myAutoFrameEnabled(false), myAutoFrameEnabled(false),
myFrameCounter(0) myFrameCounter(0),
myBitsEnabled(true),
myCollisionsEnabled(true)
{ {
// Allocate buffers for two frame buffers // Allocate buffers for two frame buffers
myCurrentFrameBuffer = new uInt8[160 * 320]; myCurrentFrameBuffer = new uInt8[160 * 320];
@ -701,6 +704,14 @@ bool TIA::toggleBit(TIABit b, uInt8 mode)
return on; return on;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIA::toggleBits()
{
myBitsEnabled = !myBitsEnabled;
enableBits(myBitsEnabled);
return myBitsEnabled;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::enableCollisions(bool mode) void TIA::enableCollisions(bool mode)
{ {
@ -744,6 +755,14 @@ bool TIA::toggleCollision(TIABit b, uInt8 mode)
return on; return on;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIA::toggleCollisions()
{
myCollisionsEnabled = !myCollisionsEnabled;
enableCollisions(myCollisionsEnabled);
return myCollisionsEnabled;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIA::toggleHMOVEBlank() bool TIA::toggleHMOVEBlank()
{ {

View File

@ -270,16 +270,8 @@ class TIA : public Device
bool scanlinePos(uInt16& x, uInt16& y) const; bool scanlinePos(uInt16& x, uInt16& y) const;
/** /**
Enables/disables all TIABit bits. Note that disabling a graphical Enables/disable/toggle the specified (or all) TIA bit(s). Note that
object also disables its collisions. disabling a graphical object also disables its collisions.
@param mode Whether to enable or disable all bits
*/
void enableBits(bool mode);
/**
Enables/disable/toggle the specified TIA bit. Note that disabling a
graphical object also disables its collisions.
@param mode 1/0 indicates on/off, and values greater than 1 mean @param mode 1/0 indicates on/off, and values greater than 1 mean
flip the bit from its current state flip the bit from its current state
@ -287,16 +279,10 @@ class TIA : public Device
@return Whether the bit was enabled or disabled @return Whether the bit was enabled or disabled
*/ */
bool toggleBit(TIABit b, uInt8 mode = 2); bool toggleBit(TIABit b, uInt8 mode = 2);
bool toggleBits();
/** /**
Enables/disables all TIABit collisions. Enables/disable/toggle the specified (or all) TIA bit collision(s).
@param mode Whether to enable or disable all collisions
*/
void enableCollisions(bool mode);
/**
Enables/disable/toggle the specified TIA bit collision.
@param mode 1/0 indicates on/off, and values greater than 1 mean @param mode 1/0 indicates on/off, and values greater than 1 mean
flip the collision from its current state flip the collision from its current state
@ -304,6 +290,7 @@ class TIA : public Device
@return Whether the collision was enabled or disabled @return Whether the collision was enabled or disabled
*/ */
bool toggleCollision(TIABit b, uInt8 mode = 2); bool toggleCollision(TIABit b, uInt8 mode = 2);
bool toggleCollisions();
/** /**
Toggle the display of HMOVE blanks. Toggle the display of HMOVE blanks.
@ -342,6 +329,21 @@ class TIA : public Device
#endif #endif
private: private:
/**
Enables/disables all TIABit bits. Note that disabling a graphical
object also disables its collisions.
@param mode Whether to enable or disable all bits
*/
void enableBits(bool mode);
/**
Enables/disables all TIABit collisions.
@param mode Whether to enable or disable all collisions
*/
void enableCollisions(bool mode);
// Update the current frame buffer to the specified color clock // Update the current frame buffer to the specified color clock
void updateFrame(Int32 clock); void updateFrame(Int32 clock);
@ -615,6 +617,9 @@ class TIA : public Device
// The framerate currently in use by the Console // The framerate currently in use by the Console
float myFramerate; float myFramerate;
// Whether TIA bits/collisions are currently enabled/disabled
bool myBitsEnabled, myCollisionsEnabled;
private: private:
// Copy constructor isn't supported by this class so make it private // Copy constructor isn't supported by this class so make it private
TIA(const TIA&); TIA(const TIA&);