mirror of https://github.com/stella-emu/stella.git
add more and fix default buttons for R77
add rewind/unwind events improve R77HelpDialog
This commit is contained in:
parent
60260843ff
commit
977359aec9
|
@ -325,6 +325,7 @@ void PhysicalJoystickHandler::setStickDefaultMapping(int stick,
|
||||||
setDefaultBtn(stick, 2, Event::CmdMenuMode);
|
setDefaultBtn(stick, 2, Event::CmdMenuMode);
|
||||||
setDefaultBtn(stick, 3, Event::OptionsMenuMode);
|
setDefaultBtn(stick, 3, Event::OptionsMenuMode);
|
||||||
setDefaultBtn(stick, 4, Event::LauncherMode);
|
setDefaultBtn(stick, 4, Event::LauncherMode);
|
||||||
|
setDefaultBtn(stick, 5, Event::Rewind10);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -340,9 +341,10 @@ void PhysicalJoystickHandler::setStickDefaultMapping(int stick,
|
||||||
|
|
||||||
// joystick (assume buttons zero..three)
|
// joystick (assume buttons zero..three)
|
||||||
setDefaultBtn( stick, 0, Event::UISelect );
|
setDefaultBtn( stick, 0, Event::UISelect );
|
||||||
setDefaultBtn( stick, 1, Event::UICancel );
|
setDefaultBtn( stick, 1, Event::UIOK );
|
||||||
setDefaultBtn( stick, 2, Event::UITabPrev );
|
setDefaultBtn( stick, 2, Event::UITabNext);
|
||||||
setDefaultBtn( stick, 3, Event::UITabNext );
|
setDefaultBtn( stick, 3, Event::UITabPrev );
|
||||||
|
setDefaultBtn( stick, 5, Event::UICancel);
|
||||||
|
|
||||||
setDefaultHat( stick, 0, JoyHat::LEFT, Event::UINavPrev );
|
setDefaultHat( stick, 0, JoyHat::LEFT, Event::UINavPrev );
|
||||||
setDefaultHat( stick, 0, JoyHat::RIGHT, Event::UINavNext );
|
setDefaultHat( stick, 0, JoyHat::RIGHT, Event::UINavNext );
|
||||||
|
|
|
@ -379,7 +379,6 @@ bool PhysicalKeyboardHandler::handleAltEvent(StellaKey key, StellaMod mod, bool
|
||||||
switch(key)
|
switch(key)
|
||||||
{
|
{
|
||||||
case KBDK_LEFT: // Alt-left(-shift) rewinds 1(10) states
|
case KBDK_LEFT: // Alt-left(-shift) rewinds 1(10) states
|
||||||
//if (!myEvent.getKeys()[KBDK_SPACE])
|
|
||||||
myHandler.enterTimeMachineMenuMode((StellaModTest::isShift(mod) && pressed) ? 10 : 1, false);
|
myHandler.enterTimeMachineMenuMode((StellaModTest::isShift(mod) && pressed) ? 10 : 1, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ class Event
|
||||||
ChangeState, LoadState, SaveState, TakeSnapshot, Quit,
|
ChangeState, LoadState, SaveState, TakeSnapshot, Quit,
|
||||||
PauseMode, OptionsMenuMode, CmdMenuMode, TimeMachineMode, DebuggerMode, LauncherMode,
|
PauseMode, OptionsMenuMode, CmdMenuMode, TimeMachineMode, DebuggerMode, LauncherMode,
|
||||||
Fry, VolumeDecrease, VolumeIncrease, SoundToggle, VidmodeDecrease, VidmodeIncrease,
|
Fry, VolumeDecrease, VolumeIncrease, SoundToggle, VidmodeDecrease, VidmodeIncrease,
|
||||||
|
Rewind, Unwind,
|
||||||
|
|
||||||
UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown,
|
UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown,
|
||||||
UISelect, UINavPrev, UINavNext, UIOK, UICancel, UIPrevDir,
|
UISelect, UINavPrev, UINavNext, UIOK, UICancel, UIPrevDir,
|
||||||
|
|
|
@ -414,6 +414,14 @@ void EventHandler::handleEvent(Event::Type event, bool pressed)
|
||||||
if(pressed) myOSystem.state().loadState();
|
if(pressed) myOSystem.state().loadState();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case Event::Rewind:
|
||||||
|
if (pressed) myOSystem.state().rewindStates();
|
||||||
|
return;
|
||||||
|
|
||||||
|
case Event::Unwind:
|
||||||
|
if (pressed) myOSystem.state().unwindStates();
|
||||||
|
return;
|
||||||
|
|
||||||
case Event::TakeSnapshot:
|
case Event::TakeSnapshot:
|
||||||
if(pressed) myOSystem.frameBuffer().tiaSurface().saveSnapShot();
|
if(pressed) myOSystem.frameBuffer().tiaSurface().saveSnapShot();
|
||||||
return;
|
return;
|
||||||
|
@ -1327,6 +1335,8 @@ EventHandler::ActionList EventHandler::ourEmulActionList[EMUL_ACTIONLIST_SIZE] =
|
||||||
{ Event::OptionsMenuMode, "Enter options menu UI", "", false },
|
{ Event::OptionsMenuMode, "Enter options menu UI", "", false },
|
||||||
{ Event::CmdMenuMode, "Toggle command menu UI", "", false },
|
{ Event::CmdMenuMode, "Toggle command menu UI", "", false },
|
||||||
{ Event::TimeMachineMode, "Toggle time machine UI", "", false },
|
{ Event::TimeMachineMode, "Toggle time machine UI", "", false },
|
||||||
|
{ Event::Rewind, "Rewind game", "", false },
|
||||||
|
{ Event::Unwind, "Unwind game", "", false },
|
||||||
{ Event::DebuggerMode, "Toggle debugger mode", "", false },
|
{ Event::DebuggerMode, "Toggle debugger mode", "", false },
|
||||||
{ Event::LauncherMode, "Enter ROM launcher", "", false },
|
{ Event::LauncherMode, "Enter ROM launcher", "", false },
|
||||||
{ Event::Quit, "Quit", "", false },
|
{ Event::Quit, "Quit", "", false },
|
||||||
|
|
|
@ -363,7 +363,7 @@ class EventHandler
|
||||||
static constexpr Int32
|
static constexpr Int32
|
||||||
COMBO_SIZE = 16,
|
COMBO_SIZE = 16,
|
||||||
EVENTS_PER_COMBO = 8,
|
EVENTS_PER_COMBO = 8,
|
||||||
EMUL_ACTIONLIST_SIZE = 83 + COMBO_SIZE,
|
EMUL_ACTIONLIST_SIZE = 85 + COMBO_SIZE,
|
||||||
MENU_ACTIONLIST_SIZE = 16
|
MENU_ACTIONLIST_SIZE = 16
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,13 @@ R77HelpDialog::R77HelpDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
addToFocusList(wid);
|
addToFocusList(wid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void R77HelpDialog::loadConfig()
|
||||||
|
{
|
||||||
|
displayInfo();
|
||||||
|
setFocus(getFocusList()[1]); // skip disabled 'Previous' button
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void R77HelpDialog::updateStrings(uInt8 page, uInt8 lines, string& title)
|
void R77HelpDialog::updateStrings(uInt8 page, uInt8 lines, string& title)
|
||||||
{
|
{
|
||||||
|
@ -107,20 +114,22 @@ void R77HelpDialog::updateStrings(uInt8 page, uInt8 lines, string& title)
|
||||||
switch (page)
|
switch (page)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
title = "Emulation commands";
|
title = "\\C\\c5Emulation commands";
|
||||||
ADD_BIND("The joystic", "ks work nor", "mal and all console");
|
ADD_BIND("The joystic", "ks work nor", "mal and all console");
|
||||||
ADD_BIND("buttons as ", "labeled exc", "ept of the following:");
|
ADD_BIND("buttons as ", "labeled exc", "ept of the following:");
|
||||||
ADD_BIND();
|
ADD_BIND();
|
||||||
ADD_BIND("Joystick", "Button", "Command");
|
ADD_BIND("Joystick", "Button", "Command");
|
||||||
ADD_LINE();
|
ADD_LINE();
|
||||||
ADD_BIND("Button 3", "4:3,16:9", "Open command dialog");
|
ADD_BIND("\\c2Button 3", "4:3,16:9", "Open command dialog");
|
||||||
ADD_BIND("Button 4", "-", "Open settings");
|
ADD_BIND("\\c2Button 4", "\\c2-", "Open settings");
|
||||||
ADD_BIND("Button 5", "FRY", "Return to launcher");
|
ADD_BIND("\\c2Button 5", "FRY", "Return to launcher");
|
||||||
|
ADD_BIND("\\c2Button 6", "-", "Rewind game");
|
||||||
|
ADD_BIND("\\c2Button 8", "MODE", "Select");
|
||||||
|
ADD_BIND("\\c2Button 9", "RESET", "Reset");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
title = "Launcher commands";
|
title = "\\C\\c5Launcher commands";
|
||||||
ADD_BIND("Joystick", "Button", "Command");
|
ADD_BIND("Joystick", "Button", "Command");
|
||||||
ADD_LINE();
|
ADD_LINE();
|
||||||
ADD_BIND("Up", "SAVE", "Previous game");
|
ADD_BIND("Up", "SAVE", "Previous game");
|
||||||
|
@ -128,26 +137,27 @@ void R77HelpDialog::updateStrings(uInt8 page, uInt8 lines, string& title)
|
||||||
ADD_BIND("Left", "LOAD", "Page up");
|
ADD_BIND("Left", "LOAD", "Page up");
|
||||||
ADD_BIND("Right", "MODE", "Page down");
|
ADD_BIND("Right", "MODE", "Page down");
|
||||||
ADD_BIND("Button 1", "SKILL P1", "Start selected game");
|
ADD_BIND("Button 1", "SKILL P1", "Start selected game");
|
||||||
ADD_BIND("Button 2", "SKILL P2", "Open power-on options");
|
ADD_BIND("\\c2Button 2", "SKILL P2", "Open power-on options");
|
||||||
ADD_BIND("Button 4", "Color,B/W", "Open settings");
|
ADD_BIND("\\c2Button 4", "Color,B/W", "Open settings");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
title = "Dialog commands";
|
title = "\\C\\c5Dialog commands";
|
||||||
ADD_BIND("Joystick", "Button", "Command");
|
ADD_BIND("Joystick", "Button", "Command");
|
||||||
ADD_LINE();
|
ADD_LINE();
|
||||||
ADD_BIND("Up", "SAVE", "Increase current setting");
|
ADD_BIND("Up", "SAVE", "Increase current setting");
|
||||||
ADD_BIND("Down", "RESET", "Decrease current setting");
|
ADD_BIND("Down", "RESET", "Decrease current setting");
|
||||||
ADD_BIND("Left", "LOAD", "Previous dialog element");
|
ADD_BIND("Left", "LOAD", "Previous dialog element");
|
||||||
ADD_BIND("Right", "MODE", "Next dialog element");
|
ADD_BIND("Right", "MODE", "Next dialog element");
|
||||||
ADD_BIND("Button 1", "SKILL P1", "Select");
|
ADD_BIND("Button 1", "SKILL P1", "Select element");
|
||||||
ADD_BIND("Button 2", "SKILL P2", "Cancel dialog");
|
ADD_BIND("\\c2Button 2", "SKILL P2", "OK");
|
||||||
ADD_BIND("Button 3", "4:3,16:9", "Previous tab");
|
ADD_BIND("\\c2Button 3", "4:3,16:9", "Previous tab");
|
||||||
ADD_BIND("Button 4", "FRY", "Next tab");
|
ADD_BIND("\\c2Button 4", "FRY", "Next tab");
|
||||||
|
ADD_BIND("\\c2Button 6", "\\c2-", "Cancel");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
title = "All commands";
|
title = "\\C\\c5All commands";
|
||||||
ADD_BIND();
|
ADD_BIND();
|
||||||
ADD_BIND("Remapped Ev", "ents", "");
|
ADD_BIND("Remapped Ev", "ents", "");
|
||||||
ADD_BIND();
|
ADD_BIND();
|
||||||
|
@ -169,15 +179,75 @@ void R77HelpDialog::displayInfo()
|
||||||
string titleStr;
|
string titleStr;
|
||||||
updateStrings(myPage, LINES_PER_PAGE, titleStr);
|
updateStrings(myPage, LINES_PER_PAGE, titleStr);
|
||||||
|
|
||||||
myTitle->setLabel(titleStr);
|
formatWidget(titleStr, myTitle);
|
||||||
for (uInt8 i = 0; i < LINES_PER_PAGE; ++i)
|
for (uInt8 i = 0; i < LINES_PER_PAGE; ++i)
|
||||||
{
|
{
|
||||||
myJoy[i]->setLabel(myJoyStr[i]);
|
formatWidget(myJoyStr[i], myJoy[i]);
|
||||||
myBtn[i]->setLabel(myBtnStr[i]);
|
formatWidget(myBtnStr[i], myBtn[i]);
|
||||||
myDesc[i]->setLabel(myDescStr[i]);
|
formatWidget(myDescStr[i], myDesc[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void R77HelpDialog::formatWidget(const string& label, StaticTextWidget* widget)
|
||||||
|
{
|
||||||
|
const char* str = label.c_str();
|
||||||
|
TextAlign align = TextAlign::Left;
|
||||||
|
ColorId color = kTextColor;
|
||||||
|
|
||||||
|
while (str[0] == '\\')
|
||||||
|
{
|
||||||
|
switch (str[1])
|
||||||
|
{
|
||||||
|
case 'C':
|
||||||
|
align = TextAlign::Center;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'L':
|
||||||
|
align = TextAlign::Left;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'R':
|
||||||
|
align = TextAlign::Right;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'c':
|
||||||
|
switch (str[2])
|
||||||
|
{
|
||||||
|
case '0':
|
||||||
|
color = kTextColor;
|
||||||
|
break;
|
||||||
|
case '1':
|
||||||
|
color = kTextColorHi;
|
||||||
|
break;
|
||||||
|
case '2':
|
||||||
|
color = kColor;
|
||||||
|
break;
|
||||||
|
case '3':
|
||||||
|
color = kShadowColor;
|
||||||
|
break;
|
||||||
|
case '4':
|
||||||
|
color = kBGColor;
|
||||||
|
break;
|
||||||
|
case '5':
|
||||||
|
color = kTextColorEm;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
str++;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
str += 2;
|
||||||
|
}
|
||||||
|
widget->setAlign(align);
|
||||||
|
widget->setTextColor(color);
|
||||||
|
widget->setLabel(str);
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void R77HelpDialog::handleCommand(CommandSender * sender, int cmd,
|
void R77HelpDialog::handleCommand(CommandSender * sender, int cmd,
|
||||||
int data, int id)
|
int data, int id)
|
||||||
|
|
|
@ -37,10 +37,11 @@ class R77HelpDialog : public Dialog
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
||||||
void updateStrings(uInt8 page, uInt8 lines, string& title);
|
void updateStrings(uInt8 page, uInt8 lines, string& title);
|
||||||
void displayInfo();
|
void displayInfo();
|
||||||
void loadConfig() override { displayInfo(); }
|
void formatWidget(const string& label, StaticTextWidget* widget);
|
||||||
|
void loadConfig() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr uInt32 LINES_PER_PAGE = 10;
|
static constexpr uInt32 LINES_PER_PAGE = 11;
|
||||||
ButtonWidget* myNextButton;
|
ButtonWidget* myNextButton;
|
||||||
ButtonWidget* myPrevButton;
|
ButtonWidget* myPrevButton;
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "NTSCFilter.hxx"
|
#include "NTSCFilter.hxx"
|
||||||
#include "PopUpWidget.hxx"
|
#include "PopUpWidget.hxx"
|
||||||
#include "MessageBox.hxx"
|
#include "MessageBox.hxx"
|
||||||
|
|
||||||
// FIXME - use the R77 define in the final release
|
// FIXME - use the R77 define in the final release
|
||||||
// use the '1' define for testing
|
// use the '1' define for testing
|
||||||
#if defined(RETRON77)
|
#if defined(RETRON77)
|
||||||
|
|
Loading…
Reference in New Issue