mirror of https://github.com/stella-emu/stella.git
Fixed my merge chaos (sorry)
This commit is contained in:
parent
cc510b1d5a
commit
980f5b92fa
|
@ -3731,12 +3731,6 @@ Ms Pac-Man (Stella extended codes):
|
||||||
<b>PAL60</b> or <b>SECAM60</b>.</td>
|
<b>PAL60</b> or <b>SECAM60</b>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<td VALIGN="TOP"><i>Display.Format:</i></td>
|
|
||||||
<td>Indicates the television format the game was designed for. The value
|
|
||||||
must be <b>Auto</b>, <b>NTSC</b>, <b>PAL</b>, <b>SECAM</b>, <b>NTSC50</b>,
|
|
||||||
<b>PAL60</b> or <b>SECAM60</b>.</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td VALIGN="TOP"><i>Display.YStart:</i></td>
|
<td VALIGN="TOP"><i>Display.YStart:</i></td>
|
||||||
<td>Indicates the scan-line to start displaying at.
|
<td>Indicates the scan-line to start displaying at.
|
||||||
|
|
|
@ -32,7 +32,8 @@ FrameBufferSDL2::FrameBufferSDL2(OSystem& osystem)
|
||||||
: FrameBuffer(osystem),
|
: FrameBuffer(osystem),
|
||||||
myWindow(nullptr),
|
myWindow(nullptr),
|
||||||
myRenderer(nullptr),
|
myRenderer(nullptr),
|
||||||
myCenter(false)
|
myCenter(false),
|
||||||
|
myRenderTargetSupport(false)
|
||||||
{
|
{
|
||||||
ASSERT_MAIN_THREAD;
|
ASSERT_MAIN_THREAD;
|
||||||
|
|
||||||
|
@ -318,7 +319,10 @@ bool FrameBufferSDL2::setVideoMode(const string& title, const VideoMode& mode)
|
||||||
const string& video = myOSystem.settings().getString("video"); // Render hint
|
const string& video = myOSystem.settings().getString("video"); // Render hint
|
||||||
if(video != "")
|
if(video != "")
|
||||||
SDL_SetHint(SDL_HINT_RENDER_DRIVER, video.c_str());
|
SDL_SetHint(SDL_HINT_RENDER_DRIVER, video.c_str());
|
||||||
|
|
||||||
myRenderer = SDL_CreateRenderer(myWindow, -1, renderFlags);
|
myRenderer = SDL_CreateRenderer(myWindow, -1, renderFlags);
|
||||||
|
detectFeatures();
|
||||||
|
|
||||||
if(myRenderer == nullptr)
|
if(myRenderer == nullptr)
|
||||||
{
|
{
|
||||||
string msg = "ERROR: Unable to create SDL renderer: " + string(SDL_GetError());
|
string msg = "ERROR: Unable to create SDL renderer: " + string(SDL_GetError());
|
||||||
|
@ -468,3 +472,44 @@ const SDL_PixelFormat& FrameBufferSDL2::pixelFormat() const
|
||||||
{
|
{
|
||||||
return *myPixelFormat;
|
return *myPixelFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void FrameBufferSDL2::detectFeatures()
|
||||||
|
{
|
||||||
|
myRenderTargetSupport = detectRenderTargetSupport();
|
||||||
|
|
||||||
|
if (myRenderer) {
|
||||||
|
if (!myRenderTargetSupport) {
|
||||||
|
Logger::info("Render targets are not supported --- QIS not available");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
bool FrameBufferSDL2::detectRenderTargetSupport()
|
||||||
|
{
|
||||||
|
if (myRenderer == nullptr) return false;
|
||||||
|
|
||||||
|
SDL_RendererInfo info;
|
||||||
|
|
||||||
|
SDL_GetRendererInfo(myRenderer, &info);
|
||||||
|
|
||||||
|
if (!(info.flags & SDL_RENDERER_TARGETTEXTURE)) return false;
|
||||||
|
|
||||||
|
SDL_Texture* tex = SDL_CreateTexture(myRenderer, myPixelFormat->format, SDL_TEXTUREACCESS_TARGET, 16, 16);
|
||||||
|
|
||||||
|
if (!tex) return false;
|
||||||
|
|
||||||
|
int sdlError = SDL_SetRenderTarget(myRenderer, tex);
|
||||||
|
SDL_SetRenderTarget(myRenderer, nullptr);
|
||||||
|
|
||||||
|
SDL_DestroyTexture(tex);
|
||||||
|
|
||||||
|
return sdlError == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
bool FrameBufferSDL2::hasRenderTargetSupport() const
|
||||||
|
{
|
||||||
|
return myRenderTargetSupport;
|
||||||
|
}
|
||||||
|
|
|
@ -129,6 +129,11 @@ class FrameBufferSDL2 : public FrameBuffer
|
||||||
*/
|
*/
|
||||||
bool isInitialized() const;
|
bool isInitialized() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Does the renderer support render targets?
|
||||||
|
*/
|
||||||
|
bool hasRenderTargetSupport() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// The following are derived from protected methods in FrameBuffer.hxx
|
// The following are derived from protected methods in FrameBuffer.hxx
|
||||||
|
@ -193,6 +198,16 @@ class FrameBufferSDL2 : public FrameBuffer
|
||||||
*/
|
*/
|
||||||
void renderToScreen() override;
|
void renderToScreen() override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
After the renderer has been created, detect the features it supports.
|
||||||
|
*/
|
||||||
|
void detectFeatures();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Detect render target support;
|
||||||
|
*/
|
||||||
|
bool detectRenderTargetSupport();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The SDL video buffer
|
// The SDL video buffer
|
||||||
SDL_Window* myWindow;
|
SDL_Window* myWindow;
|
||||||
|
@ -207,6 +222,8 @@ class FrameBufferSDL2 : public FrameBuffer
|
||||||
// last position of windowed window
|
// last position of windowed window
|
||||||
Common::Point myWindowedPos;
|
Common::Point myWindowedPos;
|
||||||
|
|
||||||
|
bool myRenderTargetSupport;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
FrameBufferSDL2() = delete;
|
FrameBufferSDL2() = delete;
|
||||||
|
|
|
@ -431,15 +431,15 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultCommo
|
||||||
|
|
||||||
{Event::VidmodeDecrease, KBDK_MINUS, MOD3},
|
{Event::VidmodeDecrease, KBDK_MINUS, MOD3},
|
||||||
{Event::VidmodeIncrease, KBDK_EQUALS, MOD3},
|
{Event::VidmodeIncrease, KBDK_EQUALS, MOD3},
|
||||||
{Event::DecreaseYStart, KBDK_PAGEUP, MOD3},
|
{Event::YStartDecrease, KBDK_PAGEUP, MOD3},
|
||||||
{Event::IncreaseYStart, KBDK_PAGEDOWN, MOD3},
|
{Event::YStartIncrease, KBDK_PAGEDOWN, MOD3},
|
||||||
{Event::VolumeDecrease, KBDK_LEFTBRACKET, MOD3},
|
{Event::VolumeDecrease, KBDK_LEFTBRACKET, MOD3},
|
||||||
{Event::VolumeIncrease, KBDK_RIGHTBRACKET, MOD3},
|
{Event::VolumeIncrease, KBDK_RIGHTBRACKET, MOD3},
|
||||||
{Event::SoundToggle, KBDK_RIGHTBRACKET, KBDM_CTRL},
|
{Event::SoundToggle, KBDK_RIGHTBRACKET, KBDM_CTRL},
|
||||||
|
|
||||||
{Event::ToggleFullScreen, KBDK_RETURN, MOD3},
|
{Event::ToggleFullScreen, KBDK_RETURN, MOD3},
|
||||||
{Event::DecreaseOverscan, KBDK_PAGEDOWN, KBDM_SHIFT},
|
{Event::OverscanDecrease, KBDK_PAGEDOWN, KBDM_SHIFT},
|
||||||
{Event::IncreaseOverScan, KBDK_PAGEUP, KBDM_SHIFT},
|
{Event::OverscanIncrease, KBDK_PAGEUP, KBDM_SHIFT},
|
||||||
{Event::VidmodeStd, KBDK_1, MOD3},
|
{Event::VidmodeStd, KBDK_1, MOD3},
|
||||||
{Event::VidmodeRGB, KBDK_2, MOD3},
|
{Event::VidmodeRGB, KBDK_2, MOD3},
|
||||||
{Event::VidmodeSVideo, KBDK_3, MOD3},
|
{Event::VidmodeSVideo, KBDK_3, MOD3},
|
||||||
|
@ -450,8 +450,8 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultCommo
|
||||||
{Event::NextAttribute, KBDK_7, MOD3},
|
{Event::NextAttribute, KBDK_7, MOD3},
|
||||||
{Event::DecreaseAttribute, KBDK_8, KBDM_SHIFT | MOD3},
|
{Event::DecreaseAttribute, KBDK_8, KBDM_SHIFT | MOD3},
|
||||||
{Event::IncreaseAttribute, KBDK_8, MOD3},
|
{Event::IncreaseAttribute, KBDK_8, MOD3},
|
||||||
{Event::DecreasePhosphor, KBDK_9, KBDM_SHIFT | MOD3},
|
{Event::PhosphorDecrease, KBDK_9, KBDM_SHIFT | MOD3},
|
||||||
{Event::IncreasePhosphor, KBDK_9, MOD3},
|
{Event::PhosphorIncrease, KBDK_9, MOD3},
|
||||||
{Event::TogglePhosphor, KBDK_P, MOD3},
|
{Event::TogglePhosphor, KBDK_P, MOD3},
|
||||||
{Event::ScanlinesDecrease, KBDK_0, KBDM_SHIFT | MOD3},
|
{Event::ScanlinesDecrease, KBDK_0, KBDM_SHIFT | MOD3},
|
||||||
{Event::ScanlinesIncrease, KBDK_0, MOD3},
|
{Event::ScanlinesIncrease, KBDK_0, MOD3},
|
||||||
|
@ -467,8 +467,8 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultCommo
|
||||||
{Event::HandleMouseControl, KBDK_0, KBDM_CTRL},
|
{Event::HandleMouseControl, KBDK_0, KBDM_CTRL},
|
||||||
{Event::ToggleGrabMouse, KBDK_G, KBDM_CTRL},
|
{Event::ToggleGrabMouse, KBDK_G, KBDM_CTRL},
|
||||||
{Event::ToggleSAPortOrder, KBDK_1, KBDM_CTRL},
|
{Event::ToggleSAPortOrder, KBDK_1, KBDM_CTRL},
|
||||||
{Event::DecreaseFormat, KBDK_F, KBDM_SHIFT | KBDM_CTRL},
|
{Event::FormatDecrease, KBDK_F, KBDM_SHIFT | KBDM_CTRL},
|
||||||
{Event::IncreaseFormat, KBDK_F, KBDM_CTRL},
|
{Event::FormatIncrease, KBDK_F, KBDM_CTRL},
|
||||||
|
|
||||||
{Event::ToggleP0Collision, KBDK_Z, KBDM_SHIFT | MOD3},
|
{Event::ToggleP0Collision, KBDK_Z, KBDM_SHIFT | MOD3},
|
||||||
{Event::ToggleP0Bit, KBDK_Z, MOD3},
|
{Event::ToggleP0Bit, KBDK_Z, MOD3},
|
||||||
|
|
|
@ -39,26 +39,9 @@ HqBlitter::~HqBlitter()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool HqBlitter::isSupported(FrameBufferSDL2 &fb)
|
bool HqBlitter::isSupported(FrameBufferSDL2 &fb)
|
||||||
{
|
{
|
||||||
ASSERT_MAIN_THREAD;
|
|
||||||
|
|
||||||
if (!fb.isInitialized()) throw runtime_error("framebuffer not initialized");
|
if (!fb.isInitialized()) throw runtime_error("framebuffer not initialized");
|
||||||
|
|
||||||
SDL_RendererInfo info;
|
return fb.hasRenderTargetSupport();
|
||||||
|
|
||||||
SDL_GetRendererInfo(fb.renderer(), &info);
|
|
||||||
|
|
||||||
if (!(info.flags & SDL_RENDERER_TARGETTEXTURE)) return false;
|
|
||||||
|
|
||||||
SDL_Texture* tex = SDL_CreateTexture(fb.renderer(), fb.pixelFormat().format, SDL_TEXTUREACCESS_TARGET, 16, 16);
|
|
||||||
|
|
||||||
if (!tex) return false;
|
|
||||||
|
|
||||||
int sdlError = SDL_SetRenderTarget(fb.renderer(), tex);
|
|
||||||
SDL_SetRenderTarget(fb.renderer(), nullptr);
|
|
||||||
|
|
||||||
SDL_DestroyTexture(tex);
|
|
||||||
|
|
||||||
return sdlError == 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -366,7 +366,7 @@ string RiotDebug::toString()
|
||||||
<< " Divider=" << myDebugger.invIfChanged(state.TIMDIV, oldstate.TIMDIV)
|
<< " Divider=" << myDebugger.invIfChanged(state.TIMDIV, oldstate.TIMDIV)
|
||||||
<< endl
|
<< endl
|
||||||
|
|
||||||
<< "Left/P0diff: " << diffP0String() << " Right/P1diff: " << diffP0String()
|
<< "Left/P0diff: " << diffP0String() << " Right/P1diff: " << diffP1String()
|
||||||
<< endl
|
<< endl
|
||||||
<< "TVType: " << tvTypeString() << " Switches: " << switchesString()
|
<< "TVType: " << tvTypeString() << " Switches: " << switchesString()
|
||||||
<< endl
|
<< endl
|
||||||
|
|
|
@ -90,19 +90,19 @@ class Event
|
||||||
ToggleBLCollision, ToggleBLBit, TogglePFCollision, TogglePFBit,
|
ToggleBLCollision, ToggleBLBit, TogglePFCollision, TogglePFBit,
|
||||||
ToggleCollisions, ToggleBits, ToggleFixedColors,
|
ToggleCollisions, ToggleBits, ToggleFixedColors,
|
||||||
|
|
||||||
DecreasePhosphor, IncreasePhosphor, TogglePhosphor, ToggleJitter,
|
PhosphorDecrease, PhosphorIncrease, TogglePhosphor, ToggleJitter,
|
||||||
ToggleFrameStats, ToggleTimeMachine,
|
ToggleFrameStats, ToggleTimeMachine,
|
||||||
ToggleContSnapshots, ToggleContSnapshotsFrame,
|
ToggleContSnapshots, ToggleContSnapshotsFrame,
|
||||||
ToggleColorLoss, TogglePalette,
|
ToggleColorLoss, TogglePalette,
|
||||||
|
|
||||||
HandleMouseControl, ToggleGrabMouse, ToggleSAPortOrder,
|
HandleMouseControl, ToggleGrabMouse, ToggleSAPortOrder,
|
||||||
DecreaseFormat, IncreaseFormat, ReloadConsole,
|
FormatDecrease, FormatIncrease, ReloadConsole,
|
||||||
|
|
||||||
Rewind1Menu, Rewind10Menu, RewindAllMenu,
|
Rewind1Menu, Rewind10Menu, RewindAllMenu,
|
||||||
Unwind1Menu, Unwind10Menu, UnwindAllMenu,
|
Unwind1Menu, Unwind10Menu, UnwindAllMenu,
|
||||||
|
|
||||||
StartPauseMode, SaveAllStates, LoadAllStates,
|
StartPauseMode, SaveAllStates, LoadAllStates,
|
||||||
DecreaseOverscan, IncreaseOverScan,
|
OverscanDecrease, OverscanIncrease,
|
||||||
|
|
||||||
ToggleAutoSlot,
|
ToggleAutoSlot,
|
||||||
|
|
||||||
|
@ -120,10 +120,9 @@ class Event
|
||||||
CompuMateQuote, CompuMateBackspace, CompuMateEquals, CompuMatePlus,
|
CompuMateQuote, CompuMateBackspace, CompuMateEquals, CompuMatePlus,
|
||||||
CompuMateSlash,
|
CompuMateSlash,
|
||||||
|
|
||||||
DecreaseYStart, IncreaseYStart,
|
YStartDecrease, YStartIncrease,
|
||||||
|
|
||||||
LastType
|
LastType
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Event categorizing groups
|
// Event categorizing groups
|
||||||
|
|
|
@ -419,11 +419,11 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
|
||||||
if(pressed) myOSystem.frameBuffer().changeVidMode(+1);
|
if(pressed) myOSystem.frameBuffer().changeVidMode(+1);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case Event::DecreaseYStart:
|
case Event::YStartDecrease:
|
||||||
if (pressed) myOSystem.console().changeYStart(-1);
|
if (pressed) myOSystem.console().changeYStart(-1);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case Event::IncreaseYStart:
|
case Event::YStartIncrease:
|
||||||
if (pressed) myOSystem.console().changeYStart(+1);
|
if (pressed) myOSystem.console().changeYStart(+1);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -431,11 +431,11 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
|
||||||
if (pressed && !repeated) myOSystem.frameBuffer().toggleFullscreen();
|
if (pressed && !repeated) myOSystem.frameBuffer().toggleFullscreen();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case Event::DecreaseOverscan:
|
case Event::OverscanDecrease:
|
||||||
if (pressed) myOSystem.frameBuffer().changeOverscan(-1);
|
if (pressed) myOSystem.frameBuffer().changeOverscan(-1);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case Event::IncreaseOverScan:
|
case Event::OverscanIncrease:
|
||||||
if (pressed) myOSystem.frameBuffer().changeOverscan(1);
|
if (pressed) myOSystem.frameBuffer().changeOverscan(1);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -507,11 +507,11 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case Event::DecreasePhosphor:
|
case Event::PhosphorDecrease:
|
||||||
if (pressed) myOSystem.console().changePhosphor(-1);
|
if (pressed) myOSystem.console().changePhosphor(-1);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case Event::IncreasePhosphor:
|
case Event::PhosphorIncrease:
|
||||||
if (pressed) myOSystem.console().changePhosphor(1);
|
if (pressed) myOSystem.console().changePhosphor(1);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -557,11 +557,11 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
|
||||||
if (pressed && !repeated) toggleSAPortOrder();
|
if (pressed && !repeated) toggleSAPortOrder();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case Event::DecreaseFormat:
|
case Event::FormatDecrease:
|
||||||
if (pressed) myOSystem.console().toggleFormat(-1);
|
if (pressed) myOSystem.console().toggleFormat(-1);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case Event::IncreaseFormat:
|
case Event::FormatIncrease:
|
||||||
if (pressed) myOSystem.console().toggleFormat(1);
|
if (pressed) myOSystem.console().toggleFormat(1);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1828,12 +1828,12 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
|
||||||
{ Event::VidmodeDecrease, "Previous zoom level", "" },
|
{ Event::VidmodeDecrease, "Previous zoom level", "" },
|
||||||
{ Event::VidmodeIncrease, "Next zoom level", "" },
|
{ Event::VidmodeIncrease, "Next zoom level", "" },
|
||||||
{ Event::ToggleFullScreen, "Toggle fullscreen", "" },
|
{ Event::ToggleFullScreen, "Toggle fullscreen", "" },
|
||||||
{ Event::DecreaseOverscan, "Decrease overscan in fullscreen mode", "" },
|
{ Event::OverscanDecrease, "Decrease overscan in fullscreen mode", "" },
|
||||||
{ Event::IncreaseOverScan, "Increase overscan in fullscreen mode", "" },
|
{ Event::OverscanIncrease, "Increase overscan in fullscreen mode", "" },
|
||||||
{ Event::DecreaseFormat, "Decrease display format", "" },
|
{ Event::FormatDecrease, "Decrease display format", "" },
|
||||||
{ Event::IncreaseFormat, "Increase display format", "" },
|
{ Event::FormatIncrease, "Increase display format", "" },
|
||||||
{ Event::DecreaseYStart, "Move display up", "" },
|
{ Event::YStartDecrease, "Move display up", "" },
|
||||||
{ Event::IncreaseYStart, "Move display down", "" },
|
{ Event::YStartIncrease, "Move display down", "" },
|
||||||
{ Event::TogglePalette, "Switch palette (Standard/Z26/User)", "" },
|
{ Event::TogglePalette, "Switch palette (Standard/Z26/User)", "" },
|
||||||
|
|
||||||
// TV effects:
|
// TV effects:
|
||||||
|
@ -1848,8 +1848,8 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
|
||||||
{ Event::DecreaseAttribute, "Decrease selected 'Custom' attribute", "" },
|
{ Event::DecreaseAttribute, "Decrease selected 'Custom' attribute", "" },
|
||||||
{ Event::IncreaseAttribute, "Increase selected 'Custom' attribute", "" },
|
{ Event::IncreaseAttribute, "Increase selected 'Custom' attribute", "" },
|
||||||
{ Event::TogglePhosphor, "Toggle 'phosphor' effect", "" },
|
{ Event::TogglePhosphor, "Toggle 'phosphor' effect", "" },
|
||||||
{ Event::DecreasePhosphor, "Decrease 'phosphor' blend", "" },
|
{ Event::PhosphorDecrease, "Decrease 'phosphor' blend", "" },
|
||||||
{ Event::IncreasePhosphor, "Increase 'phosphor' blend", "" },
|
{ Event::PhosphorIncrease, "Increase 'phosphor' blend", "" },
|
||||||
{ Event::ScanlinesDecrease, "Decrease scanlines", "" },
|
{ Event::ScanlinesDecrease, "Decrease scanlines", "" },
|
||||||
{ Event::ScanlinesIncrease, "Increase scanlines", "" },
|
{ Event::ScanlinesIncrease, "Increase scanlines", "" },
|
||||||
// Developer keys:
|
// Developer keys:
|
||||||
|
@ -1957,10 +1957,10 @@ const Event::EventSet EventHandler::AudioVideoEvents = {
|
||||||
Event::VidmodeStd, Event::VidmodeRGB, Event::VidmodeSVideo, Event::VidModeComposite, Event::VidModeBad, Event::VidModeCustom,
|
Event::VidmodeStd, Event::VidmodeRGB, Event::VidmodeSVideo, Event::VidModeComposite, Event::VidModeBad, Event::VidModeCustom,
|
||||||
Event::PreviousAttribute, Event::NextAttribute, Event::DecreaseAttribute, Event::IncreaseAttribute,
|
Event::PreviousAttribute, Event::NextAttribute, Event::DecreaseAttribute, Event::IncreaseAttribute,
|
||||||
Event::ScanlinesDecrease, Event::ScanlinesIncrease,
|
Event::ScanlinesDecrease, Event::ScanlinesIncrease,
|
||||||
Event::DecreasePhosphor, Event::IncreasePhosphor, Event::TogglePhosphor,
|
Event::PhosphorDecrease, Event::PhosphorIncrease, Event::TogglePhosphor,
|
||||||
Event::DecreaseFormat, Event::IncreaseFormat,
|
Event::FormatDecrease, Event::FormatIncrease,
|
||||||
Event::DecreaseYStart, Event::IncreaseYStart,
|
Event::YStartDecrease, Event::YStartIncrease,
|
||||||
Event::DecreaseOverscan, Event::IncreaseOverScan,
|
Event::OverscanDecrease, Event::OverscanIncrease,
|
||||||
Event::TogglePalette,
|
Event::TogglePalette,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,9 @@ Settings::Settings()
|
||||||
{
|
{
|
||||||
myRespository = make_shared<KeyValueRepositoryNoop>();
|
myRespository = make_shared<KeyValueRepositoryNoop>();
|
||||||
|
|
||||||
|
// If no version is recorded with the persisted settings, we set it to zero
|
||||||
|
setPermanent(SETTINGS_VERSION_KEY, 0);
|
||||||
|
|
||||||
// Video-related options
|
// Video-related options
|
||||||
setPermanent("video", "");
|
setPermanent("video", "");
|
||||||
setPermanent("speed", "1.0");
|
setPermanent("speed", "1.0");
|
||||||
|
@ -225,6 +228,8 @@ void Settings::load(const Options& options)
|
||||||
for (const auto& opt: fromFile)
|
for (const auto& opt: fromFile)
|
||||||
setValue(opt.first, opt.second, false);
|
setValue(opt.first, opt.second, false);
|
||||||
|
|
||||||
|
migrate();
|
||||||
|
|
||||||
// Apply commandline options, which override those from settings file
|
// Apply commandline options, which override those from settings file
|
||||||
for(const auto& opt: options)
|
for(const auto& opt: options)
|
||||||
setValue(opt.first, opt.second, false);
|
setValue(opt.first, opt.second, false);
|
||||||
|
@ -648,3 +653,29 @@ void Settings::setTemporary(const string& key, const Variant& value)
|
||||||
{
|
{
|
||||||
myTemporarySettings[key] = value;
|
myTemporarySettings[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void Settings::migrateOne()
|
||||||
|
{
|
||||||
|
const int version = getInt(SETTINGS_VERSION_KEY);
|
||||||
|
if (version >= SETTINGS_VERSION) return;
|
||||||
|
|
||||||
|
switch (version) {
|
||||||
|
case 0:
|
||||||
|
#if defined BSPF_MACOS || defined DARWIN
|
||||||
|
setPermanent("video", "");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
setPermanent(SETTINGS_VERSION_KEY, version + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void Settings::migrate()
|
||||||
|
{
|
||||||
|
while (getInt(SETTINGS_VERSION_KEY) < SETTINGS_VERSION) migrateOne();
|
||||||
|
|
||||||
|
myRespository->save(SETTINGS_VERSION_KEY, SETTINGS_VERSION);
|
||||||
|
}
|
||||||
|
|
|
@ -51,6 +51,9 @@ class Settings
|
||||||
|
|
||||||
using Options = std::map<string, Variant>;
|
using Options = std::map<string, Variant>;
|
||||||
|
|
||||||
|
static constexpr int SETTINGS_VERSION = 1;
|
||||||
|
static constexpr const char* SETTINGS_VERSION_KEY = "settings.version";
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
This method should be called to display usage information.
|
This method should be called to display usage information.
|
||||||
|
@ -134,6 +137,16 @@ class Settings
|
||||||
*/
|
*/
|
||||||
void validate();
|
void validate();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Migrate settings over one version.
|
||||||
|
*/
|
||||||
|
void migrateOne();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Migrate settings.
|
||||||
|
*/
|
||||||
|
void migrate();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Holds key/value pairs that are necessary for Stella to
|
// Holds key/value pairs that are necessary for Stella to
|
||||||
// function and must be saved on each program exit.
|
// function and must be saved on each program exit.
|
||||||
|
|
|
@ -111,13 +111,13 @@ void HelpDialog::updateStrings(uInt8 page, uInt8 lines, string& title)
|
||||||
ADD_EVENT(Event::VidmodeDecrease, "Decrease window size");
|
ADD_EVENT(Event::VidmodeDecrease, "Decrease window size");
|
||||||
ADD_EVENT(Event::ToggleFullScreen, "Toggle fullscreen /");
|
ADD_EVENT(Event::ToggleFullScreen, "Toggle fullscreen /");
|
||||||
ADD_BIND("", " windowed mode");
|
ADD_BIND("", " windowed mode");
|
||||||
ADD_EVENT(Event::IncreaseOverScan, "Increase overscan in FS mode");
|
ADD_EVENT(Event::OverscanIncrease, "Increase overscan in FS mode");
|
||||||
ADD_EVENT(Event::DecreaseOverscan, "Decrease overscan in FS mode");
|
ADD_EVENT(Event::OverscanDecrease, "Decrease overscan in FS mode");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
title = "Special commands";
|
title = "Special commands";
|
||||||
ADD_EVENT(Event::IncreaseFormat, "Switch between NTSC/PAL/SECAM");
|
ADD_EVENT(Event::FormatIncrease, "Switch between NTSC/PAL/SECAM");
|
||||||
ADD_EVENT(Event::TogglePalette, "Switch palette");
|
ADD_EVENT(Event::TogglePalette, "Switch palette");
|
||||||
ADD_EVENT(Event::TogglePhosphor, "Toggle 'phosphor' effect");
|
ADD_EVENT(Event::TogglePhosphor, "Toggle 'phosphor' effect");
|
||||||
ADD_LINE();
|
ADD_LINE();
|
||||||
|
@ -139,7 +139,7 @@ void HelpDialog::updateStrings(uInt8 page, uInt8 lines, string& title)
|
||||||
ADD_EVENT(Event::VidModeCustom, "Enable 'Custom' mode");
|
ADD_EVENT(Event::VidModeCustom, "Enable 'Custom' mode");
|
||||||
ADD_EVENT(Event::NextAttribute, "Select 'Custom' attribute");
|
ADD_EVENT(Event::NextAttribute, "Select 'Custom' attribute");
|
||||||
ADD_EVENT(Event::IncreaseAttribute, "Modify 'Custom' attribute");
|
ADD_EVENT(Event::IncreaseAttribute, "Modify 'Custom' attribute");
|
||||||
ADD_EVENT(Event::IncreasePhosphor, "Adjust phosphor blend");
|
ADD_EVENT(Event::PhosphorIncrease, "Adjust phosphor blend");
|
||||||
ADD_EVENT(Event::ScanlinesIncrease, "Adjust scanline intensity");
|
ADD_EVENT(Event::ScanlinesIncrease, "Adjust scanline intensity");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node)
|
||||||
if(mySurface == nullptr)
|
if(mySurface == nullptr)
|
||||||
{
|
{
|
||||||
mySurface = instance().frameBuffer().allocateSurface(
|
mySurface = instance().frameBuffer().allocateSurface(
|
||||||
TIAConstants::viewableWidth*2, TIAConstants::viewableHeight*2);
|
TIAConstants::viewableWidth*2, TIAConstants::viewableHeight*2, FrameBuffer::ScalingInterpolation::blur);
|
||||||
mySurface->applyAttributes();
|
mySurface->applyAttributes();
|
||||||
|
|
||||||
dialog().addSurface(mySurface);
|
dialog().addSurface(mySurface);
|
||||||
|
|
Loading…
Reference in New Issue