mirror of https://github.com/stella-emu/stella.git
Some changes to phosphor blending:
- Updated default phosphor blend to '30'. - Added shortcut keys Alt-i and Alt-o to decrease/increase phosphor blend mode dynamically, while a ROM is running. - Made range of blending 0 - 100.
This commit is contained in:
parent
47aa5d4e5f
commit
5dbd9fee51
|
@ -1550,6 +1550,18 @@
|
||||||
<td>Cmd + p</td>
|
<td>Cmd + p</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>Decrease 'phosphor' blend in phosphor mode</td>
|
||||||
|
<td>Alt + i</td>
|
||||||
|
<td>Cmd + i</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>Increase 'phosphor' blend in phosphor mode</td>
|
||||||
|
<td>Alt + o</td>
|
||||||
|
<td>Cmd + o</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Toggle palette</td>
|
<td>Toggle palette</td>
|
||||||
<td>Control + p</td>
|
<td>Control + p</td>
|
||||||
|
|
|
@ -440,6 +440,47 @@ void Console::togglePhosphor()
|
||||||
myOSystem.frameBuffer().tiaSurface().enablePhosphor(enable, blend);
|
myOSystem.frameBuffer().tiaSurface().enablePhosphor(enable, blend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void Console::changePhosphor(int direction)
|
||||||
|
{
|
||||||
|
bool enable = myProperties.get(Display_Phosphor) == "YES";
|
||||||
|
int blend = atoi(myProperties.get(Display_PPBlend).c_str());
|
||||||
|
|
||||||
|
if(enable)
|
||||||
|
{
|
||||||
|
if(direction == +1) // increase blend
|
||||||
|
{
|
||||||
|
if(blend >= 100)
|
||||||
|
{
|
||||||
|
myOSystem.frameBuffer().showMessage("Phosphor blend at maximum");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
blend = std::min(blend+2, 100);
|
||||||
|
}
|
||||||
|
else if(direction == -1) // decrease blend
|
||||||
|
{
|
||||||
|
if(blend <= 0)
|
||||||
|
{
|
||||||
|
myOSystem.frameBuffer().showMessage("Phosphor blend at minimum");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
blend = std::max(blend-2, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
ostringstream val;
|
||||||
|
val << blend;
|
||||||
|
myProperties.set(Display_PPBlend, val.str());
|
||||||
|
myOSystem.frameBuffer().showMessage("Phosphor blend " + val.str());
|
||||||
|
myOSystem.frameBuffer().tiaSurface().enablePhosphor(enable, blend);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
myOSystem.frameBuffer().showMessage("Phosphor effect disabled");
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Console::setProperties(const Properties& props)
|
void Console::setProperties(const Properties& props)
|
||||||
{
|
{
|
||||||
|
|
|
@ -210,6 +210,13 @@ class Console : public Serializable
|
||||||
*/
|
*/
|
||||||
void togglePhosphor();
|
void togglePhosphor();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Change the "Display.PPBlend" variable.
|
||||||
|
|
||||||
|
@param direction +1 indicates increase, -1 indicates decrease.
|
||||||
|
*/
|
||||||
|
void changePhosphor(int direction);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Toggles the PAL color-loss effect.
|
Toggles the PAL color-loss effect.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2368,7 +2368,7 @@ static const char* DefProps[DEF_PROPS_SIZE][21] = {
|
||||||
{ "b9336ed6d94a5cc81a16483b0a946a73", "Atari, Jerome Domurat, Michael Sierchio", "CX2667, CX2667P", "RealSports Soccer (1983) (Atari) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "" },
|
{ "b9336ed6d94a5cc81a16483b0a946a73", "Atari, Jerome Domurat, Michael Sierchio", "CX2667, CX2667P", "RealSports Soccer (1983) (Atari) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "" },
|
||||||
{ "b958d5fd9574c5cf9ece4b9421c28ecd", "Piero Cavina", "", "Multi-Sprite Game V1.0 (Piero Cavina) (PD)", "", "New Release", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
{ "b958d5fd9574c5cf9ece4b9421c28ecd", "Piero Cavina", "", "Multi-Sprite Game V1.0 (Piero Cavina) (PD)", "", "New Release", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
||||||
{ "b95a6274ca0e0c773bfdc06b4c3daa42", "Paul Slocum", "", "3-D Corridor (29-03-2003) (Paul Slocum)", "", "Homebrew", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
{ "b95a6274ca0e0c773bfdc06b4c3daa42", "Paul Slocum", "", "3-D Corridor (29-03-2003) (Paul Slocum)", "", "Homebrew", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
||||||
{ "b98cc2c6f7a0f05176f74f0f62c45488", "Spectravideo", "SV-010", "CompuMate (1983) (Spectravideo)", "", "", "", "CM", "", "", "", "", "COMPUMATE", "COMPUMATE", "", "", "", "", "", "YES", "" },
|
{ "b98cc2c6f7a0f05176f74f0f62c45488", "Spectravideo", "SV-010", "CompuMate (1983) (Spectravideo)", "", "", "", "CM", "", "", "", "", "COMPUMATE", "COMPUMATE", "", "", "", "", "", "YES", "60" },
|
||||||
{ "b9b4612358a0b2c1b4d66bb146767306", "Commavid, Ben Burch", "CM-010", "Rush Hour (1983) (Commavid) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "23", "245", "", "" },
|
{ "b9b4612358a0b2c1b4d66bb146767306", "Commavid, Ben Burch", "CM-010", "Rush Hour (1983) (Commavid) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "23", "245", "", "" },
|
||||||
{ "b9d1e3be30b131324482345959aed5e5", "Activision, Rex Bradford", "", "Kabobber (07-25-1983) (Activision) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
{ "b9d1e3be30b131324482345959aed5e5", "Activision, Rex Bradford", "", "Kabobber (07-25-1983) (Activision) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
||||||
{ "b9f6fa399b8cd386c235983ec45e4355", "Parker Brothers, John Emerson", "931511", "Action Force (1983) (Parker Bros) (PAL)", "AKA G.I. Joe - Cobra Strike", "", "", "", "", "", "", "", "PADDLES", "", "", "01 55", "", "", "", "", "" },
|
{ "b9f6fa399b8cd386c235983ec45e4355", "Parker Brothers, John Emerson", "931511", "Action Force (1983) (Parker Bros) (PAL)", "AKA G.I. Joe - Cobra Strike", "", "", "", "", "", "", "", "PADDLES", "", "", "01 55", "", "", "", "", "" },
|
||||||
|
@ -2985,7 +2985,7 @@ static const char* DefProps[DEF_PROPS_SIZE][21] = {
|
||||||
{ "e7864caaf9ec49ed67b1904ce8602690", "", "", "Donkey Kong 2K3 Pic (PD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
{ "e7864caaf9ec49ed67b1904ce8602690", "", "", "Donkey Kong 2K3 Pic (PD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
||||||
{ "e7a758bb0b43d0f7004e92b9abf4bc83", "", "", "Troll's Adventure (Hack)", "Hack of Adventure", "Hack", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
{ "e7a758bb0b43d0f7004e92b9abf4bc83", "", "", "Troll's Adventure (Hack)", "Hack of Adventure", "Hack", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
||||||
{ "e7dd8c2e6c100044002c1086d02b366e", "Activision, Steve Cartwright - Ariola", "EAX-013, PAX-013, 711 013-720", "Barnstorming (1982) (Activision) (PAL)", "AKA Die tollkeuhnen Flieger", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
{ "e7dd8c2e6c100044002c1086d02b366e", "Activision, Steve Cartwright - Ariola", "EAX-013, PAX-013, 711 013-720", "Barnstorming (1982) (Activision) (PAL)", "AKA Die tollkeuhnen Flieger", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
||||||
{ "e7f005ddb6902c648de098511f6ae2e5", "Spectravideo - Universum", "SV-010", "CompuMate (1983) (Spectravideo) (PAL)", "", "", "", "CM", "", "", "", "", "COMPUMATE", "COMPUMATE", "", "", "", "", "", "YES", "" },
|
{ "e7f005ddb6902c648de098511f6ae2e5", "Spectravideo - Universum", "SV-010", "CompuMate (1983) (Spectravideo) (PAL)", "", "", "", "CM", "", "", "", "", "COMPUMATE", "COMPUMATE", "", "", "", "", "", "YES", "60" },
|
||||||
{ "e800e4aec7c6c54c9cf3db0d1d030058", "", "", "Qb (2.06) (Retroactive) (Stella)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "" },
|
{ "e800e4aec7c6c54c9cf3db0d1d030058", "", "", "Qb (2.06) (Retroactive) (Stella)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "" },
|
||||||
{ "e80a4026d29777c3c7993fbfaee8920f", "", "", "Frisco (Unknown)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
{ "e80a4026d29777c3c7993fbfaee8920f", "", "", "Frisco (Unknown)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
|
||||||
{ "e823b13751e4388f1f2a375d3560a8d7", "Arcadia Corporation, Stephen Harland Landrum", "AR-4105", "Official Frogger (Preview) (1983) (Arcadia) [a]", "", "", "", "", "", "", "", "", "", "", "", "", "", "32", "", "", "" },
|
{ "e823b13751e4388f1f2a375d3560a8d7", "Arcadia Corporation, Stephen Harland Landrum", "AR-4105", "Official Frogger (Preview) (1983) (Arcadia) [a]", "", "", "", "", "", "", "", "", "", "", "", "", "", "32", "", "", "" },
|
||||||
|
|
|
@ -404,6 +404,14 @@ void EventHandler::handleKeyEvent(StellaKey key, StellaMod mod, bool state)
|
||||||
myOSystem.console().toggleBits();
|
myOSystem.console().toggleBits();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case KBDK_I: // Alt-i decreases phosphor blend
|
||||||
|
myOSystem.console().changePhosphor(-1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case KBDK_O: // Alt-o increases phosphor blend
|
||||||
|
myOSystem.console().changePhosphor(+1);
|
||||||
|
break;
|
||||||
|
|
||||||
case KBDK_P: // Alt-p toggles phosphor effect
|
case KBDK_P: // Alt-p toggles phosphor effect
|
||||||
myOSystem.console().togglePhosphor();
|
myOSystem.console().togglePhosphor();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -66,7 +66,7 @@ void Properties::set(PropertyType key, const string& value)
|
||||||
case Display_PPBlend:
|
case Display_PPBlend:
|
||||||
{
|
{
|
||||||
int blend = atoi(myProperties[key].c_str());
|
int blend = atoi(myProperties[key].c_str());
|
||||||
if(blend < 50 || blend > 100) blend = 77;
|
if(blend < 0 || blend > 100) blend = 30;
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
buf << blend;
|
buf << blend;
|
||||||
myProperties[key] = buf.str();
|
myProperties[key] = buf.str();
|
||||||
|
@ -324,7 +324,7 @@ const char* Properties::ourDefaultProperties[LastPropType] = {
|
||||||
"0", // Display.YStart
|
"0", // Display.YStart
|
||||||
"0", // Display.Height
|
"0", // Display.Height
|
||||||
"NO", // Display.Phosphor
|
"NO", // Display.Phosphor
|
||||||
"60" // Display.PPBlend
|
"30" // Display.PPBlend
|
||||||
};
|
};
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -223,7 +223,7 @@ void TIASurface::enableScanlineInterpolation(bool enable)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void TIASurface::enablePhosphor(bool enable, int blend)
|
void TIASurface::enablePhosphor(bool enable, int blend)
|
||||||
{
|
{
|
||||||
myUsePhosphor = enable;
|
myUsePhosphor = enable;
|
||||||
myPhosphorPercent = blend / 100.0;
|
myPhosphorPercent = blend / 100.0;
|
||||||
myFilterType = FilterType(enable ? myFilterType | 0x01 : myFilterType & 0x10);
|
myFilterType = FilterType(enable ? myFilterType | 0x01 : myFilterType & 0x10);
|
||||||
myTiaSurface->setDirty();
|
myTiaSurface->setDirty();
|
||||||
|
@ -231,7 +231,7 @@ void TIASurface::enablePhosphor(bool enable, int blend)
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
uInt32 TIASurface::getRGBPhosphor(uInt32 c, uInt32 p, uInt8 shift) const
|
inline uInt32 TIASurface::getRGBPhosphor(uInt32 c, uInt32 p, uInt8 shift) const
|
||||||
{
|
{
|
||||||
uInt8 rc, gc, bc, rp, gp, bp;
|
uInt8 rc, gc, bc, rp, gp, bp;
|
||||||
|
|
||||||
|
@ -320,11 +320,10 @@ void TIASurface::render()
|
||||||
{
|
{
|
||||||
case kNormal:
|
case kNormal:
|
||||||
{
|
{
|
||||||
uInt32 bufofsY = 0;
|
uInt32 bufofsY = 0, screenofsY = 0, pos = 0;
|
||||||
uInt32 screenofsY = 0;
|
|
||||||
for(uInt32 y = 0; y < height; ++y)
|
for(uInt32 y = 0; y < height; ++y)
|
||||||
{
|
{
|
||||||
uInt32 pos = screenofsY;
|
pos = screenofsY;
|
||||||
for(uInt32 x = 0; x < width; ++x)
|
for(uInt32 x = 0; x < width; ++x)
|
||||||
buffer[pos++] = myPalette[tiaFrame[bufofsY + x]];
|
buffer[pos++] = myPalette[tiaFrame[bufofsY + x]];
|
||||||
|
|
||||||
|
@ -335,11 +334,10 @@ void TIASurface::render()
|
||||||
}
|
}
|
||||||
case kPhosphor:
|
case kPhosphor:
|
||||||
{
|
{
|
||||||
uInt32 bufofsY = 0;
|
uInt32 bufofsY = 0, screenofsY = 0, pos = 0;
|
||||||
uInt32 screenofsY = 0;
|
|
||||||
for(uInt32 y = 0; y < height; ++y)
|
for(uInt32 y = 0; y < height; ++y)
|
||||||
{
|
{
|
||||||
uInt32 pos = screenofsY;
|
pos = screenofsY;
|
||||||
for(uInt32 x = 0; x < width; ++x)
|
for(uInt32 x = 0; x < width; ++x)
|
||||||
{
|
{
|
||||||
const uInt32 bufofs = bufofsY + x;
|
const uInt32 bufofs = bufofsY + x;
|
||||||
|
|
|
@ -14365,6 +14365,7 @@
|
||||||
"Controller.Left" "COMPUMATE"
|
"Controller.Left" "COMPUMATE"
|
||||||
"Controller.Right" "COMPUMATE"
|
"Controller.Right" "COMPUMATE"
|
||||||
"Display.Phosphor" "YES"
|
"Display.Phosphor" "YES"
|
||||||
|
"Display.PPBlend" "60"
|
||||||
""
|
""
|
||||||
|
|
||||||
"Cartridge.MD5" "b9b4612358a0b2c1b4d66bb146767306"
|
"Cartridge.MD5" "b9b4612358a0b2c1b4d66bb146767306"
|
||||||
|
@ -18155,6 +18156,7 @@
|
||||||
"Controller.Left" "COMPUMATE"
|
"Controller.Left" "COMPUMATE"
|
||||||
"Controller.Right" "COMPUMATE"
|
"Controller.Right" "COMPUMATE"
|
||||||
"Display.Phosphor" "YES"
|
"Display.Phosphor" "YES"
|
||||||
|
"Display.PPBlend" "60"
|
||||||
""
|
""
|
||||||
|
|
||||||
"Cartridge.MD5" "e800e4aec7c6c54c9cf3db0d1d030058"
|
"Cartridge.MD5" "e800e4aec7c6c54c9cf3db0d1d030058"
|
||||||
|
|
|
@ -355,7 +355,7 @@ GameInfoDialog::GameInfoDialog(
|
||||||
ypos, 8*fontWidth, lineHeight, "Blend ",
|
ypos, 8*fontWidth, lineHeight, "Blend ",
|
||||||
font.getStringWidth("Blend "),
|
font.getStringWidth("Blend "),
|
||||||
kPPBlendChanged);
|
kPPBlendChanged);
|
||||||
myPPBlend->setMinValue(50); myPPBlend->setMaxValue(100);
|
myPPBlend->setMinValue(0); myPPBlend->setMaxValue(100);
|
||||||
wid.push_back(myPPBlend);
|
wid.push_back(myPPBlend);
|
||||||
|
|
||||||
myPPBlendLabel = new StaticTextWidget(myTab, font,
|
myPPBlendLabel = new StaticTextWidget(myTab, font,
|
||||||
|
|
|
@ -70,7 +70,7 @@ my @prop_defaults = (
|
||||||
"0",
|
"0",
|
||||||
"0",
|
"0",
|
||||||
"NO",
|
"NO",
|
||||||
"60"
|
"30"
|
||||||
);
|
);
|
||||||
|
|
||||||
# Load and parse a properties file into an hash table of property
|
# Load and parse a properties file into an hash table of property
|
||||||
|
|
Loading…
Reference in New Issue