Add Reset(s) buttons.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2021-03-27 20:05:09 +00:00
parent 11c44233b4
commit b56ccf8eb4
4 changed files with 33 additions and 3 deletions

View file

@ -82,6 +82,12 @@ namespace common2
DestroyEmulator();
}
void CommonFrame::Restart()
{
Destroy();
Initialize();
}
BYTE* CommonFrame::GetResource(WORD id, LPCSTR lpType, DWORD expectedSize)
{
myResource.clear();

View file

@ -14,6 +14,7 @@ namespace common2
void Initialize() override;
void Destroy() override;
void Restart() override;
BYTE* GetResource(WORD id, LPCSTR lpType, DWORD expectedSize) override;

View file

@ -13,6 +13,7 @@
#include "Speaker.h"
#include "Mockingboard.h"
#include "Registry.h"
#include "Utilities.h"
#include "Memory.h"
#include "Debugger/Debug.h"
@ -152,7 +153,7 @@ namespace
namespace sa2
{
void ImGuiSettings::showSettings()
void ImGuiSettings::showSettings(SDLFrame* frame)
{
if (ImGui::Begin("Settings", &myShowSettings))
{
@ -177,7 +178,29 @@ namespace sa2
ImGui::Checkbox("Show Demo", &myShowDemo);
ImGui::SameLine(); HelpMarker("Show Dear ImGui DemoWindow.");
ImGui::Separator();
ImGui::Text("FPS: %d", int(io.Framerate));
ImGui::Separator();
if (ImGui::Button("Reboot"))
{
frame->Restart();
}
ImGui::SameLine();
if (ImGui::Button("ResetMachineState"))
{
ResetMachineState();
}
ImGui::SameLine();
if (ImGui::Button("CtrlReset"))
{
CtrlReset();
}
ImGui::EndTabItem();
}
@ -396,7 +419,7 @@ namespace sa2
{
if (myShowSettings)
{
showSettings();
showSettings(frame);
}
if (myShowMemory)

View file

@ -32,7 +32,7 @@ namespace sa2
std::vector<SoundInfo> myAudioInfo;
void showSettings();
void showSettings(SDLFrame* frame);
void showDebugger(SDLFrame* frame);
void showMemory();