Added toggling of HMOVE blanks to the TIA, accessed with the Alt-m key.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1872 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2009-09-09 14:02:23 +00:00
parent 42f3052fbf
commit 616ce6039a
6 changed files with 45 additions and 10 deletions

View File

@ -1853,6 +1853,12 @@
<td>Shift-Cmd + n</td> <td>Shift-Cmd + n</td>
</tr> </tr>
<tr>
<td>Toggle TIA HMOVE blanks</td>
<td>Alt + m</td>
<td>Shift-Cmd + m</td>
</tr>
<tr> <tr>
<td>Toggle TIA 'Fixed Debug Colors' mode</td> <td>Toggle TIA 'Fixed Debug Colors' mode</td>
<td>Alt + Comma</td> <td>Alt + Comma</td>

View File

@ -794,6 +794,15 @@ void Console::toggleTIABit(TIABit bit, const string& bitname, bool show) const
myOSystem->frameBuffer().showMessage(message); myOSystem->frameBuffer().showMessage(message);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::toggleHMOVE() const
{
if(myTIA->toggleHMOVEBlank())
myOSystem->frameBuffer().showMessage("HMOVE blanking enabled");
else
myOSystem->frameBuffer().showMessage("HMOVE blanking disabled");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::enableBits(bool enable) const void Console::enableBits(bool enable) const
{ {

View File

@ -262,6 +262,7 @@ class Console : public Serializable
void toggleM1Bit() const { toggleTIABit(M1Bit, "M1"); } void toggleM1Bit() const { toggleTIABit(M1Bit, "M1"); }
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 enableBits(bool enable) const; void enableBits(bool enable) const;
/** /**

View File

@ -392,6 +392,10 @@ void EventHandler::poll(uInt64 time)
myOSystem->console().togglePFBit(); myOSystem->console().togglePFBit();
break; break;
case SDLK_m:
myOSystem->console().toggleHMOVE();
break;
case SDLK_COMMA: case SDLK_COMMA:
myOSystem->console().toggleFixedColors(); myOSystem->console().toggleFixedColors();
break; break;

View File

@ -126,6 +126,7 @@ void TIA::reset()
// Currently no objects are enabled or selectively disabled // Currently no objects are enabled or selectively disabled
myEnabledObjects = 0; myEnabledObjects = 0;
myDisabledObjects = 0; myDisabledObjects = 0;
myAllowHMOVEBlanks = true;
// Some default values for the registers // Some default values for the registers
myColorPtr = myColor; myColorPtr = myColor;
@ -509,8 +510,8 @@ bool TIA::load(Serializer& in)
mySound.load(in); mySound.load(in);
// Reset TIA bits to be on // Reset TIA bits to be on
// TODO - should we enable this, or leave it to the user? enableBits(true);
// enableBits(true); myAllowHMOVEBlanks = true;
myColorPtr = myColor; myColorPtr = myColor;
} }
catch(const char* msg) catch(const char* msg)
@ -741,6 +742,13 @@ bool TIA::toggleBit(TIABit b, uInt8 mode)
return on; return on;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIA::toggleHMOVEBlank()
{
myAllowHMOVEBlanks = myAllowHMOVEBlanks ? false : true;
return myAllowHMOVEBlanks;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIA::toggleFixedColors(uInt8 mode) bool TIA::toggleFixedColors(uInt8 mode)
{ {
@ -953,9 +961,10 @@ void TIA::updateFrame(Int32 clock)
// TODO - 08-27-2009: Simulate the weird effects of Cosmic Ark and // TODO - 08-27-2009: Simulate the weird effects of Cosmic Ark and
// Stay Frosty. The movement itself is well understood, but there // Stay Frosty. The movement itself is well understood, but there
// also seems to be some widening and blanking occurring as well. // also seems to be some widening and blanking occurring as well.
// This doesn't properly emulate the effect, but it does give a // This doesn't properly emulate the effect at a low level; it only
// fair approximation. More testing is required to figure out // simulates the behaviour as visually seen in the aforementioned
// what's really going on here. // ROMs. Other ROMs may break this simulation; more testing is
// required to figure out what's really going on here.
if(myHMM0mmr && myPOSM0 % 4 == 3) if(myHMM0mmr && myPOSM0 % 4 == 3)
{ {
// Stretch this missle so it's 4 pixels wide, with the 3rd pixel // Stretch this missle so it's 4 pixels wide, with the 3rd pixel
@ -1026,7 +1035,7 @@ void TIA::updateFrame(Int32 clock)
// TODO - 01-21-99: These should be reset right after the first copy // TODO - 01-21-99: These should be reset right after the first copy
// of the player has passed. However, for now we'll just reset at the // of the player has passed. However, for now we'll just reset at the
// end of the scanline since the other way would be to slow. // end of the scanline since the other way would be too slow.
mySuppressP0 = mySuppressP1 = 0; mySuppressP0 = mySuppressP1 = 0;
} }
} }
@ -1838,11 +1847,9 @@ void TIA::poke(uInt16 addr, uInt8 value)
int hpos = (clock - myClockWhenFrameStarted) % 228 - HBLANK; int hpos = (clock - myClockWhenFrameStarted) % 228 - HBLANK;
myCurrentHMOVEPos = hpos; myCurrentHMOVEPos = hpos;
// Figure out what cycle we're at
Int32 x = ((clock - myClockWhenFrameStarted) % 228) / 3;
// See if we need to enable the HMOVE blank bug // See if we need to enable the HMOVE blank bug
myHMOVEBlankEnabled = TIATables::HMOVEBlankEnableCycles[x]; myHMOVEBlankEnabled = myAllowHMOVEBlanks ?
TIATables::HMOVEBlankEnableCycles[((clock - myClockWhenFrameStarted) % 228) / 3] : false;
#ifdef USE_MMR_LATCHES #ifdef USE_MMR_LATCHES
// Do we have to undo some of the already applied cycles from an // Do we have to undo some of the already applied cycles from an

View File

@ -265,6 +265,13 @@ class TIA : public Device
*/ */
bool toggleBit(TIABit b, uInt8 mode = 2); bool toggleBit(TIABit b, uInt8 mode = 2);
/**
Toggle the display of HMOVE blanks.
@return Whether the HMOVE blanking was enabled or disabled
*/
bool toggleHMOVEBlank();
/** /**
Enables/disable/toggle 'fixed debug colors' mode. Enables/disable/toggle 'fixed debug colors' mode.
@ -525,6 +532,7 @@ class TIA : public Device
Int32 myCurrentHMOVEPos; Int32 myCurrentHMOVEPos;
Int32 myPreviousHMOVEPos; Int32 myPreviousHMOVEPos;
bool myHMOVEBlankEnabled; bool myHMOVEBlankEnabled;
bool myAllowHMOVEBlanks;
// Indicates if unused TIA pins are floating on a peek // Indicates if unused TIA pins are floating on a peek
bool myFloatTIAOutputPins; bool myFloatTIAOutputPins;