This commit is contained in:
Thomas Jentzsch 2020-05-07 16:17:08 +02:00
commit a8e0b4438d
22 changed files with 795 additions and 78 deletions

View File

@ -22,6 +22,8 @@
a game. This allows the user to save high scores for these games. For each a game. This allows the user to save high scores for these games. For each
game and variation, the top 10 scores can be saved. (TODO: Doc) game and variation, the top 10 scores can be saved. (TODO: Doc)
* Added 'Custom' palette, generated from user controlled phase shifts.
* Added 'Turbo' mode, runs the game as fast as the computer allows. * Added 'Turbo' mode, runs the game as fast as the computer allows.
* Added selectable dialog fonts * Added selectable dialog fonts

View File

@ -1396,19 +1396,19 @@
</tr> </tr>
<tr> <tr>
<td>Toggle 'phosphor' effect</td> <td>Toggle 'phosphor' mode</td>
<td>Alt + p</td> <td>Alt + p</td>
<td>Cmd + p</td> <td>Cmd + p</td>
</tr> </tr>
<tr> <tr>
<td>Decrease 'phosphor' blend in phosphor mode</td> <td>Decrease 'phosphor' blend</td>
<td>Shift-Alt + 9</td> <td>Shift-Alt + 9</td>
<td>Shift-Cmd + 9</td> <td>Shift-Cmd + 9</td>
</tr> </tr>
<tr> <tr>
<td>Increase 'phosphor' blend in phosphor mode</td> <td>Increase 'phosphor' blend</td>
<td>Alt + 9</td> <td>Alt + 9</td>
<td>Cmd + 9</td> <td>Cmd + 9</td>
</tr> </tr>
@ -1426,7 +1426,7 @@
<tr> <tr>
<td colspan="3"><center><font size="-1"> <td colspan="3"><center><font size="-1">
Items marked as (*) are only available in 'Custom' preset mode</font></center></td> Items marked as (*) will also switch to 'Custom' preset mode</font></center></td>
</tr> </tr>
</table> </table>
@ -1578,18 +1578,18 @@
<td>Cmd + Enter</td> <td>Cmd + Enter</td>
</tr> </tr>
<tr>
<td>Increase overscan in fullscreen mode</td>
<td>Shift + PageUp</td>
<td>Shift + PageUp</td>
</tr>
<tr> <tr>
<td>Decrease overscan in fullscreen mode</td> <td>Decrease overscan in fullscreen mode</td>
<td>Shift + PageDown</td> <td>Shift + PageDown</td>
<td>Shift + PageDown</td> <td>Shift + PageDown</td>
</tr> </tr>
<tr>
<td>Increase overscan in fullscreen mode</td>
<td>Shift + PageUp</td>
<td>Shift + PageUp</td>
</tr>
<tr> <tr>
<td>Move display <i>up</i> (uses "Display.VCenter")</td> <td>Move display <i>up</i> (uses "Display.VCenter")</td>
<td>Alt + PageUp</td> <td>Alt + PageUp</td>
@ -1602,12 +1602,6 @@
<td>Cmd + PageDown</td> <td>Cmd + PageDown</td>
</tr> </tr>
<tr>
<td>Switch display format in <i>increasing</i> order (NTSC/PAL/SECAM etc.)</td>
<td>Control + f</td>
<td>Control + f</td>
</tr>
<tr> <tr>
<td>Switch display format in <i>decreasing</i> order (NTSC/PAL/SECAM etc.)</td> <td>Switch display format in <i>decreasing</i> order (NTSC/PAL/SECAM etc.)</td>
<td>Shift-Control + f</td> <td>Shift-Control + f</td>
@ -1615,11 +1609,29 @@
</tr> </tr>
<tr> <tr>
<td>Switch palette (Standard/Z26/User)</td> <td>Switch display format in <i>increasing</i> order (NTSC/PAL/SECAM etc.)</td>
<td>Control + f</td>
<td>Control + f</td>
</tr>
<tr>
<td>Switch palette (Standard/Z26/User/Custom)</td>
<td>Control + p</td> <td>Control + p</td>
<td>Control + p</td> <td>Control + p</td>
</tr> </tr>
<tr>
<td>Decrease custom palette phase shift (switches to 'Custom' palette)</td>
<td>Shift-Control + 9</td>
<td>Shift-Control + 9</td>
</tr>
<tr>
<td>Increase custom palette phase shift (switches to 'Custom' palette)</td>
<td>Control + 9</td>
<td>Control + 9</td>
</tr>
<tr> <tr>
<td>Toggle display interpolation</td> <td>Toggle display interpolation</td>
<td>Control + i</td> <td>Control + i</td>
@ -2010,9 +2022,20 @@
</tr> </tr>
<tr> <tr>
<td><pre>-palette &lt;standard|z26|user&gt;</pre></td> <td><pre>-palette &lt;standard|z26|user|custom&gt;</pre></td>
<td>Set the palette to either normal Stella, the one used in the z26 <td>Set the palette to either normal Stella, the one used in the z26
emulator, or a user-defined palette.</td> emulator, a user-defined palette, or a custom palette generated
from user-defined phase shifts.</td>
</tr>
<tr>
<td><pre>-phase_ntsc &lt;number&gt;</pre></td>
<td>Set phase shift for custom NTSC palette.</td>
</tr>
<tr>
<td><pre>-phase_pal &lt;number&gt;</pre></td>
<td>Set phase shift for custom PAL palette.</td>
</tr> </tr>
<tr> <tr>
@ -2847,6 +2870,8 @@
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">CommandLine</a></th></tr> <tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">CommandLine</a></th></tr>
<tr><td>Renderer</td><td>Use specified rendering mode</td><td>-video</td></tr> <tr><td>Renderer</td><td>Use specified rendering mode</td><td>-video</td></tr>
<tr><td>Palette</td><td>Palette for emulation mode</td><td>-palette</td></tr> <tr><td>Palette</td><td>Palette for emulation mode</td><td>-palette</td></tr>
<tr><td>NTSC phase</td><td>Phase shift for custom NTSC palette</td><td>-phase_ntsc</td></tr>
<tr><td>PAL phase</td><td>Phase shift for custom PAL palette</td><td>-phase_pal</td></tr>
<tr><td>Interpolation</td><td>Interpolation for TIA image</td><td>-tia.inter</td></tr> <tr><td>Interpolation</td><td>Interpolation for TIA image</td><td>-tia.inter</td></tr>
<tr><td>Zoom</td><td>Zoom level for emulation mode </td><td>-tia.zoom</td></tr> <tr><td>Zoom</td><td>Zoom level for emulation mode </td><td>-tia.zoom</td></tr>
<tr><td>V-Size adjust</td><td>Adjust height of TIA image</td><td>-tia.vsizeadjust</td></tr> <tr><td>V-Size adjust</td><td>Adjust height of TIA image</td><td>-tia.vsizeadjust</td></tr>
@ -4124,6 +4149,10 @@ Ms Pac-Man (Stella extended codes):
<td><b>user</b></td> <td><b>user</b></td>
<td>An external palette file, supplied by the user.</td> <td>An external palette file, supplied by the user.</td>
</tr> </tr>
<tr>
<td><b>custom</b></td>
<td>A palette generate from user-defined phase shift.</td>
</tr>
</table> </table>
<p>A user-defined palette has certain restrictions, further described as follows: <p>A user-defined palette has certain restrictions, further described as follows:

View File

@ -492,6 +492,8 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultCommo
{Event::ScanlinesIncrease, KBDK_0, MOD3}, {Event::ScanlinesIncrease, KBDK_0, MOD3},
{Event::ToggleColorLoss, KBDK_L, KBDM_CTRL}, {Event::ToggleColorLoss, KBDK_L, KBDM_CTRL},
{Event::TogglePalette, KBDK_P, KBDM_CTRL}, {Event::TogglePalette, KBDK_P, KBDM_CTRL},
{Event::ColorShiftDecrease, KBDK_9, KBDM_SHIFT | KBDM_CTRL},
{Event::ColorShiftIncrease, KBDK_9, KBDM_CTRL},
{Event::ToggleInter, KBDK_I, KBDM_CTRL}, {Event::ToggleInter, KBDK_I, KBDM_CTRL},
{Event::ToggleTurbo, KBDK_T, KBDM_CTRL}, {Event::ToggleTurbo, KBDK_T, KBDM_CTRL},
{Event::ToggleJitter, KBDK_J, MOD3}, {Event::ToggleJitter, KBDK_J, MOD3},

View File

@ -84,6 +84,10 @@ Console::Console(OSystem& osystem, unique_ptr<Cartridge>& cart,
// Load user-defined palette for this ROM // Load user-defined palette for this ROM
loadUserPalette(); loadUserPalette();
// Generate custom palette
generateCustomPalette(0);
generateCustomPalette(1);
// Create subsystems for the console // Create subsystems for the console
my6502 = make_unique<M6502>(myOSystem.settings()); my6502 = make_unique<M6502>(myOSystem.settings());
myRiot = make_unique<M6532>(*this, myOSystem.settings()); myRiot = make_unique<M6532>(*this, myOSystem.settings());
@ -473,6 +477,21 @@ void Console::enableColorLoss(bool state)
myTIA->enableColorLoss(state); myTIA->enableColorLoss(state);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int Console::getPaletteNum(const string& name) const
{
if(name == "z26")
return PaletteType::Z26;
if(name == "user" && myUserPaletteDefined)
return PaletteType::User;
if(name == "custom")
return PaletteType::Custom;
return PaletteType::Standard;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::togglePalette() void Console::togglePalette()
{ {
@ -495,14 +514,14 @@ void Console::togglePalette()
} }
else else
{ {
palette = "standard"; palette = "custom";
message = "Standard Stella palette"; message = "Custom palette";
} }
} }
else if(palette == "user") // switch to standard else if(palette == "user") // switch to custom
{ {
palette = "standard"; palette = "custom";
message = "Standard Stella palette"; message = "Custom palette";
} }
else // switch to standard mode if we get this far else // switch to standard mode if we get this far
{ {
@ -521,20 +540,20 @@ void Console::setPalette(const string& type)
{ {
// Look at all the palettes, since we don't know which one is // Look at all the palettes, since we don't know which one is
// currently active // currently active
static constexpr BSPF::array2D<PaletteArray*, 3, 3> palettes = {{ static constexpr BSPF::array2D<PaletteArray*, PaletteType::NumTypes, 3> palettes = {{
{ &ourNTSCPalette, &ourPALPalette, &ourSECAMPalette }, { &ourNTSCPalette, &ourPALPalette, &ourSECAMPalette },
{ &ourNTSCPaletteZ26, &ourPALPaletteZ26, &ourSECAMPaletteZ26 }, { &ourNTSCPaletteZ26, &ourPALPaletteZ26, &ourSECAMPaletteZ26 },
{ &ourUserNTSCPalette, &ourUserPALPalette, &ourUserSECAMPalette } { &ourUserNTSCPalette, &ourUserPALPalette, &ourUserSECAMPalette },
{ &ourCustomNTSCPalette, &ourCustomPALPalette, &ourSECAMPalette }
}}; }};
// See which format we should be using // See which format we should be using
int paletteNum = 0; int paletteNum = getPaletteNum(type);
if(type == "standard")
paletteNum = 0; if(paletteNum == PaletteType::Custom)
else if(type == "z26") {
paletteNum = 1;
else if(type == "user" && myUserPaletteDefined) }
paletteNum = 2;
// Now consider the current display format // Now consider the current display format
const PaletteArray* palette = const PaletteArray* palette =
@ -658,6 +677,8 @@ FBInitStatus Console::initializeVideo(bool full)
myOSystem.frameBuffer().showFrameStats( myOSystem.frameBuffer().showFrameStats(
myOSystem.settings().getBool(devSettings ? "dev.stats" : "plr.stats")); myOSystem.settings().getBool(devSettings ? "dev.stats" : "plr.stats"));
generateCustomPalette(0);
generateCustomPalette(1);
generateColorLossPalette(); generateColorLossPalette();
} }
setPalette(myOSystem.settings().getString("palette")); setPalette(myOSystem.settings().getString("palette"));
@ -805,6 +826,46 @@ void Console::changeScanlineAdjust(int direction)
myOSystem.frameBuffer().showMessage(ss.str()); myOSystem.frameBuffer().showMessage(ss.str());
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::changeColorPhaseShift(int direction)
{
const char DEGREE = 0x1c;
const float NTSC_SHIFT = 26.2F;
const float PAL_SHIFT = 31.3F; // 360 / 11.5
const bool isNTSC = myDisplayFormat == "NTSC" || myDisplayFormat == "NTSC50";
const bool isPAL = myDisplayFormat == "PAL" || myDisplayFormat == "PAL60";
// SECAM is not supported
if(isNTSC || isPAL)
{
const string key = isNTSC ? "phase_ntsc" : "phase_pal";
const float shift = isNTSC ? NTSC_SHIFT : PAL_SHIFT;
float phase = myOSystem.settings().getFloat(key);
if(direction == +1) // increase color phase shift
{
phase += 0.3F;
phase = std::min(phase, shift + 4.5F);
}
else if(direction == -1) // decrease color phase shift
{
phase -= 0.3F;
phase = std::max(phase, shift - 4.5F);
}
myOSystem.settings().setValue(key, phase);
generateCustomPalette(isNTSC ? 0 : 1);
myOSystem.settings().setValue("palette", "custom");
setPalette("custom");
ostringstream ss;
ss << "Color phase shift at "
<< std::fixed << std::setprecision(1) << phase << DEGREE;
myOSystem.frameBuffer().showMessage(ss.str());
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::setTIAProperties() void Console::setTIAProperties()
{ {
@ -1056,15 +1117,129 @@ void Console::loadUserPalette()
myUserPaletteDefined = true; myUserPaletteDefined = true;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::generateCustomPalette(int type)
{
const int NUM_CHROMA = 16;
const int NUM_LUMA = 8;
const double SATURATION = 0.25;
double color[NUM_CHROMA][2] = {{0.0}};
if(type == 0)
{
// YIQ is YUV shifted by 33°
const double offset = 33 * (2 * M_PI / 360);
const double shift = myOSystem.settings().getFloat("phase_ntsc") * (2 * M_PI / 360);
// color 0 is grayscale
for(int chroma = 1; chroma < NUM_CHROMA; chroma++)
{
color[chroma][0] = SATURATION * sin(offset + shift * (chroma - 1));
color[chroma][1] = SATURATION * sin(offset + shift * (chroma - 1 - M_PI));
}
for(int chroma = 0; chroma < NUM_CHROMA; chroma++)
{
const double I = color[chroma][0];
const double Q = color[chroma][1];
for(int luma = 0; luma < NUM_LUMA; luma++)
{
const double Y = 0.05 + luma / 8.24; // 0.05..~0.90
double R = Y + 0.956 * I + 0.621 * Q;
double G = Y - 0.272 * I - 0.647 * Q;
double B = Y - 1.106 * I + 1.703 * Q;
if(R < 0) R = 0;
if(G < 0) G = 0;
if(B < 0) B = 0;
R = pow(R, 0.9);
G = pow(G, 0.9);
B = pow(B, 0.9);
if(R > 1) R = 1;
if(G > 1) G = 1;
if(B > 1) B = 1;
int r = R * 255.F;
int g = G * 255.F;
int b = B * 255.F;
ourCustomNTSCPalette[(chroma * NUM_LUMA + luma) << 1] = (r << 16) + (g << 8) + b;
}
}
}
else
{
const double offset = 180 * (2 * M_PI / 360);
const double shift = myOSystem.settings().getFloat("phase_pal") * (2 * M_PI / 360);
const double fixedShift = 22.5 * (2 * M_PI / 360);
// colors 0, 1, 14 and 15 are grayscale
for(int chroma = 2; chroma < NUM_CHROMA - 2; chroma++)
{
int idx = NUM_CHROMA - 1 - chroma;
color[idx][0] = SATURATION * sin(offset - fixedShift * chroma);
if ((idx & 1) == 0)
color[idx][1] = SATURATION * sin(offset - shift * (chroma - 3.5) / 2.F);
else
color[idx][1] = SATURATION * -sin(offset - shift * chroma / 2.F);
}
for(int chroma = 0; chroma < NUM_CHROMA; chroma++)
{
const double U = color[chroma][0];
const double V = color[chroma][1];
for(int luma = 0; luma < NUM_LUMA; luma++)
{
const double Y = 0.05 + luma / 8.24; // 0.05..~0.90
// Most sources
double R = Y + 1.403 * V;
double G = Y - 0.344 * U - 0.714 * V;
double B = Y + 1.770 * U;
// German Wikipedia, huh???
//double B = Y + 1 / 0.493 * U;
//double R = Y + 1 / 0.877 * V;
//double G = 1.704 * Y - 0.590 * R - 0.194 * B;
if(R < 0) R = 0.0;
if(G < 0) G = 0.0;
if(B < 0) B = 0.0;
R = pow(R, 1.2);
G = pow(G, 1.2);
B = pow(B, 1.2);
if(R > 1) R = 1;
if(G > 1) G = 1;
if(B > 1) B = 1;
int r = R * 255.F;
int g = G * 255.F;
int b = B * 255.F;
ourCustomPALPalette[(chroma * NUM_LUMA + luma) << 1] = (r << 16) + (g << 8) + b;
}
}
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::generateColorLossPalette() void Console::generateColorLossPalette()
{ {
// Look at all the palettes, since we don't know which one is // Look at all the palettes, since we don't know which one is
// currently active // currently active
std::array<uInt32*, 9> palette = { std::array<uInt32*, 3 * PaletteType::NumTypes> palette = {
ourNTSCPalette.data(), ourPALPalette.data(), ourSECAMPalette.data(), ourNTSCPalette.data(), ourPALPalette.data(), ourSECAMPalette.data(),
ourNTSCPaletteZ26.data(), ourPALPaletteZ26.data(), ourSECAMPaletteZ26.data(), ourNTSCPaletteZ26.data(), ourPALPaletteZ26.data(), ourSECAMPaletteZ26.data(),
nullptr, nullptr, nullptr nullptr, nullptr, nullptr,
ourCustomNTSCPalette.data(), ourCustomPALPalette.data(), ourSECAMPalette.data(),
}; };
if(myUserPaletteDefined) if(myUserPaletteDefined)
{ {
@ -1073,7 +1248,7 @@ void Console::generateColorLossPalette()
palette[8] = ourUserSECAMPalette.data(); palette[8] = ourUserSECAMPalette.data();
} }
for(int i = 0; i < 9; ++i) for(int i = 0; i < 3 * PaletteType::NumTypes; ++i)
{ {
if(palette[i] == nullptr) if(palette[i] == nullptr)
continue; continue;
@ -1388,3 +1563,9 @@ PaletteArray Console::ourUserPALPalette = { 0 }; // filled from external file
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PaletteArray Console::ourUserSECAMPalette = { 0 }; // filled from external file PaletteArray Console::ourUserSECAMPalette = { 0 }; // filled from external file
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PaletteArray Console::ourCustomNTSCPalette = { 0 }; // filled by function
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PaletteArray Console::ourCustomPALPalette = { 0 }; // filled by function

View File

@ -209,6 +209,11 @@ class Console : public Serializable, public ConsoleIO
*/ */
void togglePalette(); void togglePalette();
/**
Generates a custom palette, based on user defined phase shifts.
*/
void generateCustomPalette(int type);
/** /**
Sets the palette according to the given palette name. Sets the palette according to the given palette name.
@ -283,6 +288,16 @@ class Console : public Serializable, public ConsoleIO
*/ */
void changeScanlineAdjust(int direction); void changeScanlineAdjust(int direction);
/**
Change the "phase shift" variable.
Note that there are two of these (NTSC and PAL). The currently
active mode will determine which one is used.
@param direction +1 indicates increase, -1 indicates decrease.
*/
void changeColorPhaseShift(int direction);
/** /**
Returns the current framerate. Returns the current framerate.
*/ */
@ -377,10 +392,22 @@ class Console : public Serializable, public ConsoleIO
*/ */
void generateColorLossPalette(); void generateColorLossPalette();
int getPaletteNum(const string& name) const;
void toggleTIABit(TIABit bit, const string& bitname, bool show = true) const; void toggleTIABit(TIABit bit, const string& bitname, bool show = true) const;
void toggleTIACollision(TIABit bit, const string& bitname, bool show = true) const; void toggleTIACollision(TIABit bit, const string& bitname, bool show = true) const;
private: private:
enum PaletteType {
Standard,
Z26,
User,
Custom,
NumTypes
};
// Reference to the osystem object // Reference to the osystem object
OSystem& myOSystem; OSystem& myOSystem;
@ -462,6 +489,10 @@ class Console : public Serializable, public ConsoleIO
static PaletteArray ourUserPALPalette; static PaletteArray ourUserPALPalette;
static PaletteArray ourUserSECAMPalette; static PaletteArray ourUserSECAMPalette;
// Table of RGB values for NTSC, PAL - custom-defined
static PaletteArray ourCustomNTSCPalette;
static PaletteArray ourCustomPALPalette;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
Console() = delete; Console() = delete;

View File

@ -121,6 +121,7 @@ class Event
// add new events from here to avoid that user remapped events get overwritten // add new events from here to avoid that user remapped events get overwritten
ToggleTurbo, ToggleTurbo,
ColorShiftDecrease, ColorShiftIncrease,
LastType LastType
}; };

View File

@ -435,6 +435,14 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
if (pressed) myOSystem.console().changeScanlineAdjust(+1); if (pressed) myOSystem.console().changeScanlineAdjust(+1);
return; return;
case Event::ColorShiftDecrease:
if (pressed) myOSystem.console().changeColorPhaseShift(-1);
return;
case Event::ColorShiftIncrease:
if (pressed) myOSystem.console().changeColorPhaseShift(+1);
return;
case Event::ToggleFullScreen: case Event::ToggleFullScreen:
if (pressed && !repeated) myOSystem.frameBuffer().toggleFullscreen(); if (pressed && !repeated) myOSystem.frameBuffer().toggleFullscreen();
return; return;
@ -1915,15 +1923,16 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::OverscanIncrease, "Increase overscan in fullscreen mode", "" }, { Event::OverscanIncrease, "Increase overscan in fullscreen mode", "" },
{ Event::VidmodeDecrease, "Previous zoom level", "" }, { Event::VidmodeDecrease, "Previous zoom level", "" },
{ Event::VidmodeIncrease, "Next zoom level", "" }, { Event::VidmodeIncrease, "Next zoom level", "" },
{ Event::ScanlineAdjustIncrease, "Increase vertical display size", "" },
{ Event::ScanlineAdjustDecrease, "Decrease vertical display size", "" }, { Event::ScanlineAdjustDecrease, "Decrease vertical display size", "" },
{ Event::ScanlineAdjustIncrease, "Increase vertical display size", "" },
{ Event::VCenterDecrease, "Move display up", "" }, { Event::VCenterDecrease, "Move display up", "" },
{ Event::VCenterIncrease, "Move display down", "" }, { Event::VCenterIncrease, "Move display down", "" },
{ Event::FormatDecrease, "Decrease display format", "" }, { Event::FormatDecrease, "Decrease display format", "" },
{ Event::FormatIncrease, "Increase display format", "" }, { Event::FormatIncrease, "Increase display format", "" },
{ Event::TogglePalette, "Switch palette (Standard/Z26/User)", "" }, { Event::TogglePalette, "Switch palette (Std./Z26/User/Cust.)", "" },
{ Event::ColorShiftDecrease, "Decrease custom palette phase shift", "" },
{ Event::ColorShiftIncrease, "Increase custom palette phase shift", "" },
{ Event::ToggleInter, "Toggle display interpolation", "" }, { Event::ToggleInter, "Toggle display interpolation", "" },
// TV effects: // TV effects:
{ Event::VidmodeStd, "Disable TV effects", "" }, { Event::VidmodeStd, "Disable TV effects", "" },
{ Event::VidmodeRGB, "Select 'RGB' preset", "" }, { Event::VidmodeRGB, "Select 'RGB' preset", "" },
@ -2049,7 +2058,8 @@ const Event::EventSet EventHandler::AudioVideoEvents = {
Event::VCenterDecrease, Event::VCenterIncrease, Event::VCenterDecrease, Event::VCenterIncrease,
Event::ScanlineAdjustDecrease, Event::ScanlineAdjustIncrease, Event::ScanlineAdjustDecrease, Event::ScanlineAdjustIncrease,
Event::OverscanDecrease, Event::OverscanIncrease, Event::OverscanDecrease, Event::OverscanIncrease,
Event::TogglePalette, Event::ToggleInter Event::TogglePalette, Event::ColorShiftDecrease, Event::ColorShiftIncrease,
Event::ToggleInter
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -468,7 +468,7 @@ class EventHandler
#else #else
PNG_SIZE = 0, PNG_SIZE = 0,
#endif #endif
EMUL_ACTIONLIST_SIZE = 145 + PNG_SIZE + COMBO_SIZE, EMUL_ACTIONLIST_SIZE = 149 + PNG_SIZE + COMBO_SIZE,
MENU_ACTIONLIST_SIZE = 18 MENU_ACTIONLIST_SIZE = 18
; ;

View File

@ -46,6 +46,8 @@ Settings::Settings()
setPermanent("windowedpos", Common::Point(50, 50)); setPermanent("windowedpos", Common::Point(50, 50));
setPermanent("display", 0); setPermanent("display", 0);
setPermanent("palette", "standard"); setPermanent("palette", "standard");
setPermanent("phase_ntsc", "26.2");
setPermanent("phase_pal", "31.3");
setPermanent("uimessages", "true"); setPermanent("uimessages", "true");
// TIA specific options // TIA specific options
@ -356,7 +358,7 @@ void Settings::validate()
else if(i > 10) setValue("ssinterval", "10"); else if(i > 10) setValue("ssinterval", "10");
s = getString("palette"); s = getString("palette");
if(s != "standard" && s != "z26" && s != "user") if(s != "standard" && s != "z26" && s != "user" && s != "custom")
setValue("palette", "standard"); setValue("palette", "standard");
s = getString("launcherfont"); s = getString("launcherfont");
@ -403,8 +405,10 @@ void Settings::usage() const
<< " -windowedpos <XxY> Sets the window position in windowed emulator mode\n" << " -windowedpos <XxY> Sets the window position in windowed emulator mode\n"
<< " -display <number> Sets the display for Stella's emulator\n" << " -display <number> Sets the display for Stella's emulator\n"
<< " -palette <standard| Use the specified color palette\n" << " -palette <standard| Use the specified color palette\n"
<< " z26|\n" << " z26|user|\n"
<< " user>\n" << " custom>\n"
<< " -phase_ntsc <number> Phase shift for NTSC custom color palette\n"
<< " -phase_pal <number> Phase shift for PAL custom color palette\n"
<< " -speed <number> Run emulation at the given speed\n" << " -speed <number> Run emulation at the given speed\n"
<< " -turbo <1|0> Enable 'Turbo' mode for maximum emulation speed\n" << " -turbo <1|0> Enable 'Turbo' mode for maximum emulation speed\n"
<< " -uimessages <1|0> Show onscreen UI messages for different events\n" << " -uimessages <1|0> Show onscreen UI messages for different events\n"

View File

@ -193,9 +193,21 @@ void TIASurface::setScanlineIntensity(int amount)
{ {
ostringstream buf; ostringstream buf;
uInt32 intensity = enableScanlines(amount); uInt32 intensity = enableScanlines(amount);
buf << "Scanline intensity at " << intensity << "%";
if(intensity == 0)
buf << "Scanlines disabled";
else
{
buf << "Scanline intensity at ";
if(intensity < 100)
buf << intensity << "%";
else
buf << "maximum";
}
myOSystem.settings().setValue("tv.scanlines", intensity); myOSystem.settings().setValue("tv.scanlines", intensity);
enableNTSC(ntscEnabled());
myFB.showMessage(buf.str()); myFB.showMessage(buf.str());
} }

View File

@ -273,7 +273,9 @@ void CommandDialog::updatePalette()
label = "Stella Palette"; label = "Stella Palette";
else if(BSPF::equalsIgnoreCase(palette, "z26")) else if(BSPF::equalsIgnoreCase(palette, "z26"))
label = "Z26 Palette"; label = "Z26 Palette";
else else if(BSPF::equalsIgnoreCase(palette, "user"))
label = "User Palette"; label = "User Palette";
else
label = "Custom Palette";
myPaletteButton->setLabel(label); myPaletteButton->setLabel(label);
} }

View File

@ -42,6 +42,41 @@ namespace GUI {
// Font character bitmap data. // Font character bitmap data.
static const uInt16 consoleB_font_bits[] = { // NOLINT : too complicated to convert static const uInt16 consoleB_font_bits[] = { // NOLINT : too complicated to convert
/* MODIFIED
Character 28 (0x1c):
width 8
bbx ( 8, 13, 0, -2 )
+--------+
| |
| XXXX |
| XX XX |
| XX XX |
| XX XX |
| XXXX |
| |
| |
| |
| |
| |
| |
| |
+--------+
*/
0x0000,
0b0011110000000000,
0b0110011000000000,
0b0110011000000000,
0b0110011000000000,
0b0011110000000000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
/* MODIFIED /* MODIFIED
Character 29 (0x1d): Character 29 (0x1d):
@ -3386,8 +3421,8 @@ static const FontDesc consoleBDesc = {
13, 13,
8, 13, 0, -2, 8, 13, 0, -2,
11, 11,
29, 28,
98, 99,
consoleB_font_bits, consoleB_font_bits,
nullptr, /* no encode table*/ nullptr, /* no encode table*/
nullptr, /* fixed width*/ nullptr, /* fixed width*/

View File

@ -42,6 +42,45 @@ namespace GUI {
// Font character bitmap data. // Font character bitmap data.
static const uInt16 consoleMediumB_font_bits[] = { // NOLINT : too complicated to convert static const uInt16 consoleMediumB_font_bits[] = { // NOLINT : too complicated to convert
/* MODIFIED
Character 28 (0x1c): ellipsis
width 9
bbx ( 9, 15, 0, -3 )
+---------+
| |
| |
| XXXX |
| XX XX |
| XX XX |
| XX XX |
| XXXX |
| |
| |
| |
| |
| |
| |
| |
| |
+---------+
*/
0x0000,
0x0000,
0b0011110000000000,
0b0110011000000000,
0b0110011000000000,
0b0110011000000000,
0b0011110000000000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
/* MODIFIED /* MODIFIED
Character 29 (0x1d): ellipsis Character 29 (0x1d): ellipsis
width 9 width 9
@ -3777,8 +3816,8 @@ static const FontDesc consoleMediumBDesc = {
15, 15,
9, 15, 0, -3, 9, 15, 0, -3,
12, 12,
29, 28,
98, 99,
consoleMediumB_font_bits, consoleMediumB_font_bits,
nullptr, /* no encode table*/ nullptr, /* no encode table*/
nullptr, /* fixed width*/ nullptr, /* fixed width*/

View File

@ -264,8 +264,9 @@ void DeveloperDialog::addTiaTab(const GUI::Font& font)
wid.push_back(myPFColorWidget); wid.push_back(myPFColorWidget);
ypos += lineHeight + VGAP * 1; ypos += lineHeight + VGAP * 1;
mySwapLabel = new StaticTextWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1, ostringstream ss;
"Delayed VDEL" + ELLIPSIS + " swap for"); ss << "Delayed VDEL" << ELLIPSIS << " swap for";
mySwapLabel = new StaticTextWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1, ss.str());
wid.push_back(mySwapLabel); wid.push_back(mySwapLabel);
ypos += lineHeight + VGAP * 1; ypos += lineHeight + VGAP * 1;

View File

@ -90,8 +90,9 @@ class GuiObject : public CommandReceiver
/** Redraw the focus list */ /** Redraw the focus list */
virtual void redrawFocus() { } virtual void redrawFocus() { }
/** Special character for menues */ /** Special characters for menues */
const string ELLIPSIS = "\x1d"; const string ELLIPSIS = "\x1d";
const string DEGREE = "\x1c";
protected: protected:
virtual void releaseFocus() = 0; virtual void releaseFocus() = 0;

View File

@ -42,6 +42,62 @@ namespace GUI {
// Font character bitmap data. // Font character bitmap data.
static const uInt16 stella12x24t_font_bits[] = { // NOLINT : too complicated to convert static const uInt16 stella12x24t_font_bits[] = { // NOLINT : too complicated to convert
/* Character 28 (0x1c):
width 12
bbx ( 12, 24, 0, -5 )
+------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+------------+
*/
0x0000,
0x0000,
0x0000,
0x0000,
0b0000111000000000,
0b0001101100000000,
0b0011000110000000,
0b0011000110000000,
0b0011000110000000,
0b0001101100000000,
0b0000111000000000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
/* Character 29 (0x1d): /* Character 29 (0x1d):
width 12 width 12
bbx ( 12, 24, 0, -5 ) bbx ( 12, 24, 0, -5 )
@ -5538,8 +5594,8 @@ static const FontDesc stella12x24tDesc = {
24, 24,
12, 24, 0, -5, 12, 24, 0, -5,
19, 19,
29, 28,
98, 99,
stella12x24t_font_bits, stella12x24t_font_bits,
nullptr, /* no encode table*/ nullptr, /* no encode table*/
nullptr, /* fixed width*/ nullptr, /* fixed width*/

View File

@ -42,7 +42,72 @@ namespace GUI {
// Font character bitmap data. // Font character bitmap data.
static const uInt16 stella14x28t_font_bits[] = { // NOLINT : too complicated to convert static const uInt16 stella14x28t_font_bits[] = { // NOLINT : too complicated to convert
/* Character 32 (0x20): /* Character 28 (0x1c):
width 14
bbx ( 14, 28, 0, -6 )
+--------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+--------------+
*/
0x0000,
0x0000,
0x0000,
0x0000,
0b0000011110000000,
0b0000111111000000,
0b0001110011100000,
0b0001100001100000,
0b0001100001100000,
0b0001110011100000,
0b0000111111000000,
0b0000011110000000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
/* Character 29 (0x1d):
width 14 width 14
bbx ( 14, 28, 0, -6 ) bbx ( 14, 28, 0, -6 )
@ -6322,8 +6387,8 @@ static const FontDesc stella14x28tDesc = {
28, 28,
14, 28, 0, -6, 14, 28, 0, -6,
22, 22,
29, 28,
98, 99,
stella14x28t_font_bits, stella14x28t_font_bits,
nullptr, /* no encode table*/ nullptr, /* no encode table*/
nullptr, /* fixed width*/ nullptr, /* fixed width*/

View File

@ -42,6 +42,78 @@ namespace GUI {
// Font character bitmap data. // Font character bitmap data.
static const uInt16 stella16x32t_font_bits[] = { // NOLINT : too complicated to convert static const uInt16 stella16x32t_font_bits[] = { // NOLINT : too complicated to convert
/* Character 28 (0x1c):
width 16
bbx ( 16, 32, 0, -6 )
+----------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+----------------+
*/
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0b0000111110000000,
0b0001111111000000,
0b0011110111100000,
0b0011100011100000,
0b0011100011100000,
0b0011110111100000,
0b0001111111000000,
0b0000111110000000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
/* Character 29 (0x1d): /* Character 29 (0x1d):
width 16 width 16
bbx ( 16, 32, 0, -6 ) bbx ( 16, 32, 0, -6 )
@ -7106,8 +7178,8 @@ static const FontDesc stella16x32tDesc = {
32, 32,
16, 32, 0, -6, 16, 32, 0, -6,
26, 26,
29, 28,
98, 99,
stella16x32t_font_bits, stella16x32t_font_bits,
nullptr, /* no encode table*/ nullptr, /* no encode table*/
nullptr, /* fixed width*/ nullptr, /* fixed width*/

View File

@ -42,6 +42,55 @@ namespace GUI {
// Font character bitmap data. // Font character bitmap data.
static const uInt16 stellaLarge_font_bits[] = { // NOLINT : too complicated to convert static const uInt16 stellaLarge_font_bits[] = { // NOLINT : too complicated to convert
/* MODIFIED
Character 28 (0x1c):
width 10
bbx ( 10, 20, 0, -4 )
+----------+
| |
| |
| |
| XXXX |
| XX XX |
| XX XX |
| XX XX |
| XX XX |
| XXXX |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+----------+
*/
0x0000,
0x0000,
0x0000,
0b0001111000000000,
0b0011001100000000,
0b0011001100000000,
0b0011001100000000,
0b0011001100000000,
0b0001111000000000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
/* MODIFIED /* MODIFIED
Character 29 (0x1d): Character 29 (0x1d):
width 10 width 10
@ -4759,8 +4808,8 @@ static const FontDesc stellaLargeDesc = {
20, 20,
10, 20, 0, -4, 10, 20, 0, -4,
16, 16,
29, 28,
98, 99,
stellaLarge_font_bits, stellaLarge_font_bits,
nullptr, /* no encode table*/ nullptr, /* no encode table*/
nullptr, /* fixed width*/ nullptr, /* fixed width*/

View File

@ -43,6 +43,52 @@ namespace GUI {
static const uInt16 stellaMedium_font_bits[] = { // NOLINT : too complicated to convert static const uInt16 stellaMedium_font_bits[] = { // NOLINT : too complicated to convert
/* MODIFIED
Character 28 (0x1c): degree
width 9
bbx ( 9, 15, 0, -3 )
+---------+
| |
| |
| |
| |
| |
| XXXXXX |
| X X|
| X X|
| XXXXXX |
| |
| |
| |
| XX XX XX|
| XX XX XX|
| |
| |
| |
| |
+---------+
*/
0x0000,
0x0000,
0x0000,
0x0000,
0b0001111000000000,
0b0011001100000000,
0b0011001100000000,
0b0011001100000000,
0b0001111000000000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
/* MODIFIED /* MODIFIED
Character 29 (0x1d): ellipsis Character 29 (0x1d): ellipsis
width 9 width 9
@ -4367,8 +4413,8 @@ static const FontDesc stellaMediumDesc = {
18, 18,
9, 18, 0, -4, 9, 18, 0, -4,
14, 14,
29, 28,
98, 99,
stellaMedium_font_bits, stellaMedium_font_bits,
nullptr, /* no encode table*/ nullptr, /* no encode table*/
nullptr, /* fixed width*/ nullptr, /* fixed width*/

View File

@ -89,14 +89,13 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
int xpos, ypos, tabID; int xpos, ypos, tabID;
int lwidth = font.getStringWidth("V-Size adjust "), int lwidth = font.getStringWidth("V-Size adjust "),
pwidth = font.getStringWidth("XXXXxXXXX"), pwidth = font.getStringWidth("XXXXxXXXX");
swidth = font.getMaxCharWidth() * 10 - 2;
WidgetArray wid; WidgetArray wid;
VariantList items; VariantList items;
// Set real dimensions // Set real dimensions
setSize(60 * fontWidth + HBORDER * 2, setSize(57 * fontWidth + HBORDER * 2 + PopUpWidget::dropDownWidth(font) * 2,
_th + VGAP * 3 + lineHeight + 11 * (lineHeight + VGAP) + buttonHeight + VBORDER * 3, _th + VGAP * 3 + lineHeight + 11 * (lineHeight + VGAP) + buttonHeight + VBORDER * 3,
max_w, max_h); max_w, max_h);
@ -125,11 +124,32 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
VarList::push_back(items, "z26", "z26"); VarList::push_back(items, "z26", "z26");
if (instance().checkUserPalette()) if (instance().checkUserPalette())
VarList::push_back(items, "User", "user"); VarList::push_back(items, "User", "user");
VarList::push_back(items, "Custom", "custom");
myTIAPalette = new PopUpWidget(myTab, font, xpos, ypos, pwidth, myTIAPalette = new PopUpWidget(myTab, font, xpos, ypos, pwidth,
lineHeight, items, "Palette ", lwidth); lineHeight, items, "Palette ", lwidth, kPaletteChanged);
wid.push_back(myTIAPalette); wid.push_back(myTIAPalette);
ypos += lineHeight + VGAP; ypos += lineHeight + VGAP;
int swidth = myTIAPalette->getWidth() - lwidth;
int plWidth = font.getStringWidth("NTSC phase ");
int pswidth = swidth - INDENT + lwidth - plWidth;
myPhaseShiftNtsc =
new SliderWidget(myTab, font, xpos + INDENT, ypos-1, pswidth, lineHeight,
"NTSC phase", plWidth, kNtscShiftChanged, fontWidth * 5);
myPhaseShiftNtsc->setMinValue(262 - 45); myPhaseShiftNtsc->setMaxValue(262 + 45);
myPhaseShiftNtsc->setTickmarkIntervals(4);
wid.push_back(myPhaseShiftNtsc);
ypos += lineHeight + VGAP;
myPhaseShiftPal =
new SliderWidget(myTab, font, xpos + INDENT, ypos-1, pswidth, lineHeight,
"PAL phase", plWidth, kPalShiftChanged, fontWidth * 5);
myPhaseShiftPal->setMinValue(313 - 45); myPhaseShiftPal->setMaxValue(313 + 45);
myPhaseShiftPal->setTickmarkIntervals(4);
wid.push_back(myPhaseShiftPal);
ypos += lineHeight + VGAP * 4;
// TIA interpolation // TIA interpolation
myTIAInterpolate = new CheckboxWidget(myTab, font, xpos, ypos + 1, "Interpolation "); myTIAInterpolate = new CheckboxWidget(myTab, font, xpos, ypos + 1, "Interpolation ");
wid.push_back(myTIAInterpolate); ypos += lineHeight + VGAP; wid.push_back(myTIAInterpolate); ypos += lineHeight + VGAP;
@ -264,7 +284,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
CREATE_CUSTOM_SLIDERS(Fringe, "Fringing ", 0) CREATE_CUSTOM_SLIDERS(Fringe, "Fringing ", 0)
CREATE_CUSTOM_SLIDERS(Bleed, "Bleeding ", 0) CREATE_CUSTOM_SLIDERS(Bleed, "Bleeding ", 0)
xpos += myTVContrast->getWidth() + fontWidth * 4; xpos += myTVContrast->getWidth() + fontWidth * 6;
ypos = VBORDER; ypos = VBORDER;
lwidth = font.getStringWidth("Intensity "); lwidth = font.getStringWidth("Intensity ");
@ -287,7 +307,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
xpos += INDENT; xpos += INDENT;
CREATE_CUSTOM_SLIDERS(ScanIntense, "Intensity ", kScanlinesChanged) CREATE_CUSTOM_SLIDERS(ScanIntense, "Intensity ", kScanlinesChanged)
ypos += lineHeight + 2; ypos += VGAP * 3;
// Adjustable presets // Adjustable presets
xpos -= INDENT; xpos -= INDENT;
@ -345,6 +365,11 @@ void VideoDialog::loadConfig()
myTIAPalette->setSelected( myTIAPalette->setSelected(
instance().settings().getString("palette"), "standard"); instance().settings().getString("palette"), "standard");
// Custom Palette
myPhaseShiftNtsc->setValue(instance().settings().getFloat("phase_ntsc") * 10);
myPhaseShiftPal->setValue(instance().settings().getFloat("phase_pal") * 10);
handlePaletteChange();
// TIA interpolation // TIA interpolation
myTIAInterpolate->setState(instance().settings().getBool("tia.inter")); myTIAInterpolate->setState(instance().settings().getBool("tia.inter"));
@ -417,6 +442,10 @@ void VideoDialog::saveConfig()
instance().settings().setValue("palette", instance().settings().setValue("palette",
myTIAPalette->getSelectedTag().toString()); myTIAPalette->getSelectedTag().toString());
// Custom Palette
instance().settings().setValue("phase_ntsc", myPhaseShiftNtsc->getValue() / 10.0);
instance().settings().setValue("phase_pal", myPhaseShiftPal->getValue() / 10.0);
// TIA interpolation // TIA interpolation
instance().settings().setValue("tia.inter", myTIAInterpolate->getState()); instance().settings().setValue("tia.inter", myTIAInterpolate->getState());
@ -484,12 +513,21 @@ void VideoDialog::saveConfig()
// TV scanline intensity // TV scanline intensity
instance().settings().setValue("tv.scanlines", myTVScanIntense->getValueLabel()); instance().settings().setValue("tv.scanlines", myTVScanIntense->getValueLabel());
if (instance().hasConsole()) if(instance().hasConsole())
{
instance().console().setTIAProperties(); instance().console().setTIAProperties();
if (vsizeChanged && instance().hasConsole()) { if(instance().settings().getString("palette") == "custom")
instance().console().tia().clearFrameBuffer(); {
instance().console().initializeVideo(); instance().console().generateCustomPalette(0);
instance().console().generateCustomPalette(1);
}
if(vsizeChanged)
{
instance().console().tia().clearFrameBuffer();
instance().console().initializeVideo();
}
} }
// Finally, issue a complete framebuffer re-initialization... // Finally, issue a complete framebuffer re-initialization...
@ -509,6 +547,8 @@ void VideoDialog::setDefaults()
myRenderer->setSelectedIndex(0); myRenderer->setSelectedIndex(0);
myTIAZoom->setValue(300); myTIAZoom->setValue(300);
myTIAPalette->setSelected("standard", ""); myTIAPalette->setSelected("standard", "");
myPhaseShiftNtsc->setValue(262);
myPhaseShiftPal->setValue(313);
myTIAInterpolate->setState(false); myTIAInterpolate->setState(false);
myVSizeAdjust->setValue(0); myVSizeAdjust->setValue(0);
mySpeed->setValue(0); mySpeed->setValue(0);
@ -521,6 +561,8 @@ void VideoDialog::setDefaults()
myCenter->setState(false); myCenter->setState(false);
myFastSCBios->setState(true); myFastSCBios->setState(true);
myUseThreads->setState(false); myUseThreads->setState(false);
handlePaletteChange();
break; break;
} }
@ -586,6 +628,15 @@ void VideoDialog::loadTVAdjustables(NTSCFilter::Preset preset)
myTVGamma->setValue(adj.gamma); myTVGamma->setValue(adj.gamma);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoDialog::handlePaletteChange()
{
bool enable = myTIAPalette->getSelectedTag().toString() == "custom";
myPhaseShiftNtsc->setEnabled(enable);
myPhaseShiftPal->setEnabled(enable);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoDialog::handleFullScreenChange() void VideoDialog::handleFullScreenChange()
{ {
@ -627,6 +678,28 @@ void VideoDialog::handleCommand(CommandSender* sender, int cmd,
setDefaults(); setDefaults();
break; break;
case kPaletteChanged:
handlePaletteChange();
break;
case kNtscShiftChanged:
{
std::ostringstream ss;
ss << std::setw(4) << std::fixed << std::setprecision(1)
<< (0.1 * abs(myPhaseShiftNtsc->getValue())) << DEGREE;
myPhaseShiftNtsc->setValueLabel(ss.str());
break;
}
case kPalShiftChanged:
{
std::ostringstream ss;
ss << std::setw(4) << std::fixed << std::setprecision(1)
<< (0.1 * abs(myPhaseShiftPal->getValue())) << DEGREE;
myPhaseShiftPal->setValueLabel(ss.str());
break;
}
case kVSizeChanged: case kVSizeChanged:
{ {
int adjust = myVSizeAdjust->getValue(); int adjust = myVSizeAdjust->getValue();

View File

@ -45,6 +45,7 @@ class VideoDialog : public Dialog
void handleTVModeChange(NTSCFilter::Preset); void handleTVModeChange(NTSCFilter::Preset);
void loadTVAdjustables(NTSCFilter::Preset preset); void loadTVAdjustables(NTSCFilter::Preset preset);
void handlePaletteChange();
void handleFullScreenChange(); void handleFullScreenChange();
void handleOverscanChange(); void handleOverscanChange();
void handlePhosphorChange(); void handlePhosphorChange();
@ -57,6 +58,8 @@ class VideoDialog : public Dialog
PopUpWidget* myRenderer{nullptr}; PopUpWidget* myRenderer{nullptr};
SliderWidget* myTIAZoom{nullptr}; SliderWidget* myTIAZoom{nullptr};
PopUpWidget* myTIAPalette{nullptr}; PopUpWidget* myTIAPalette{nullptr};
SliderWidget* myPhaseShiftNtsc{nullptr};
SliderWidget* myPhaseShiftPal{nullptr};
CheckboxWidget* myTIAInterpolate{nullptr}; CheckboxWidget* myTIAInterpolate{nullptr};
SliderWidget* myVSizeAdjust{nullptr}; SliderWidget* myVSizeAdjust{nullptr};
SliderWidget* mySpeed{nullptr}; SliderWidget* mySpeed{nullptr};
@ -100,6 +103,9 @@ class VideoDialog : public Dialog
ButtonWidget* myCloneCustom{nullptr}; ButtonWidget* myCloneCustom{nullptr};
enum { enum {
kPaletteChanged = 'VDpl',
kNtscShiftChanged = 'VDns',
kPalShiftChanged = 'VDps',
kSpeedupChanged = 'VDSp', kSpeedupChanged = 'VDSp',
kVSizeChanged = 'VDVs', kVSizeChanged = 'VDVs',
kFullScreenChanged = 'VDFs', kFullScreenChanged = 'VDFs',