Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions SerialPrograms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,10 @@ file(GLOB MAIN_SOURCES
Source/PokemonLA/Resources/PokemonLA_PokemonSprites.h
Source/PokemonLA/Resources/PokemonLA_WeatherAndTimeIcons.cpp
Source/PokemonLA/Resources/PokemonLA_WeatherAndTimeIcons.h
Source/PokemonRSE/PokemonRSE_Panels.cpp
Source/PokemonRSE/PokemonRSE_Panels.h
Source/PokemonRSE/PokemonRSE_Settings.cpp
Source/PokemonRSE/PokemonRSE_Settings.h
Source/PokemonSV/Inference/Battles/PokemonSV_BattleBallReader.cpp
Source/PokemonSV/Inference/Battles/PokemonSV_BattleBallReader.h
Source/PokemonSV/Inference/Battles/PokemonSV_EncounterWatcher.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const std::set<std::string> TOKENS{
"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", // jw's token.
"e8d168bc482e96553ea9f9ecaea5a817474dbccc2a6a228a6bde67f2b2aa2889", // James' token.
"7555b7c63481cad42306718c67e7f9def5bfd1da8f6cd299ccd3d7dc95f307ae", // Kuro's token.
"3d475b46d121fc24559d100de2426feaa53cd6578aac2817c4857a610ccde2dd", // kichi's token.
};


Expand Down
5 changes: 5 additions & 0 deletions SerialPrograms/Source/PanelLists.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
#include "CommonFramework/PersistentSettings.h"
#include "CommonFramework/Windows/DpiScaler.h"
#include "CommonFramework/Panels/UI/PanelListWidget.h"
#include "CommonFramework/GlobalSettingsPanel.h"
#include "NintendoSwitch/NintendoSwitch_Panels.h"
#include "PokemonSwSh/PokemonSwSh_Panels.h"
#include "PokemonHome/PokemonHome_Panels.h"
#include "PokemonBDSP/PokemonBDSP_Panels.h"
#include "PokemonLA/PokemonLA_Panels.h"
#include "PokemonRSE/PokemonRSE_Panels.h"
#include "PokemonSV/PokemonSV_Panels.h"
#include "ZeldaTotK/ZeldaTotK_Panels.h"
#include "PanelLists.h"
Expand Down Expand Up @@ -47,6 +49,9 @@ ProgramSelect::ProgramSelect(QWidget& parent, PanelHolder& holder)
add(std::make_unique<NintendoSwitch::PokemonBDSP::PanelListFactory>());
add(std::make_unique<NintendoSwitch::PokemonLA::PanelListFactory>());
add(std::make_unique<NintendoSwitch::PokemonSV::PanelListFactory>());
if (PreloadSettings::instance().DEVELOPER_MODE) {
add(std::make_unique<NintendoSwitch::PokemonRSE::PanelListFactory>());
}
add(std::make_unique<NintendoSwitch::ZeldaTotK::PanelListFactory>());


Expand Down
55 changes: 55 additions & 0 deletions SerialPrograms/Source/PokemonRSE/PokemonRSE_Panels.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Pokemon RSE Panels
*
* From: https://github.com/PokemonAutomation/Arduino-Source
*
*/

#include "CommonFramework/GlobalSettingsPanel.h"
#include "Pokemon/Pokemon_Strings.h"
#include "PokemonRSE_Panels.h"

#include "PokemonRSE_Settings.h"

//#include "Programs/ShinyHunting/PokemonRSE_AudioStarterReset.h"
//#include "Programs/ShinyHunting/PokemonRSE_StarterReset.h"
//#include "Programs/TestPrograms/PokemonRSE_SoundListener.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonRSE{



PanelListFactory::PanelListFactory()
: PanelListDescriptor("Pokemon Ruby and Sapphire, Pokemon Emerald")
{}

std::vector<PanelEntry> PanelListFactory::make_panels() const{
std::vector<PanelEntry> ret;

ret.emplace_back("---- Settings ----");
ret.emplace_back(make_settings<GameSettings_Descriptor, GameSettingsPanel>());

//ret.emplace_back("---- General ----");

ret.emplace_back("---- Shiny Hunting ----");
//ret.emplace_back(make_single_switch_program<AudioStarterReset_Descriptor, AudioStarterReset>());


if (PreloadSettings::instance().DEVELOPER_MODE){
ret.emplace_back("---- Test ----");
//ret.emplace_back(make_single_switch_program<StarterReset_Descriptor, StarterReset>()); //outdated early test program

ret.emplace_back("---- Developer Tools ----");
//ret.emplace_back(make_single_switch_program<SoundListener_Descriptor, SoundListener>());
}

return ret;
}




}
}
}
29 changes: 29 additions & 0 deletions SerialPrograms/Source/PokemonRSE/PokemonRSE_Panels.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* Pokemon RSE Panels
*
* From: https://github.com/PokemonAutomation/Arduino-Source
*
*/

#ifndef PokemonAutomation_PokemonRSE_Panels_H
#define PokemonAutomation_PokemonRSE_Panels_H

#include "CommonFramework/Panels/PanelList.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonRSE{



class PanelListFactory : public PanelListDescriptor{
public:
PanelListFactory();
virtual std::vector<PanelEntry> make_panels() const;
};



}
}
}
#endif
99 changes: 99 additions & 0 deletions SerialPrograms/Source/PokemonRSE/PokemonRSE_Settings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/* Pokemon RSE Settings
*
* From: https://github.com/PokemonAutomation/Arduino-Source
*
*/

#include "Common/NintendoSwitch/NintendoSwitch_ControllerDefs.h"
#include "CommonFramework/Globals.h"

#include "PokemonRSE_Settings.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonRSE{



GameSettings& GameSettings::instance(){
static GameSettings settings;
return settings;
}
GameSettings::GameSettings()
: BatchOption(LockMode::LOCK_WHILE_RUNNING)
, m_menu_navigation("<font size=4><b>Menu Navigation Timings:</b></font>")
, GAME_TO_HOME_DELAY(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many of these are relevant to GBA? Stuff like the Home menu didn't exist on the real thing.

"<b>Game to Home Delay:</b><br>Delay from pressing home to entering the the Switch home menu.",
LockMode::LOCK_WHILE_RUNNING,
TICKS_PER_SECOND,
"125"
)
, m_soft_reset_timings("<font size=4><b>Soft Reset Timings:</b></font>")
, START_BUTTON_MASH(
"<b>1. Start Button Mash:</b><br>Mash Start for this long after a soft reset to get to the main menu.",
LockMode::LOCK_WHILE_RUNNING,
TICKS_PER_SECOND,
"5 * TICKS_PER_SECOND"
)
, ENTER_GAME_WAIT(
"<b>2. Enter Game Wait:</b><br>Wait this long for the game to load.",
LockMode::LOCK_WHILE_RUNNING,
TICKS_PER_SECOND,
"3 * TICKS_PER_SECOND"
)
, m_shiny_audio_settings("<font size=4><b>Shiny Audio Settings:</b></font>")
, SHINY_SOUND_THRESHOLD(
"<b>Shiny Sound Threshold:</b><br>Maximum error coefficient to trigger a shiny detection.",
LockMode::LOCK_WHILE_RUNNING,
0.97, 0, 1.0
)
, SHINY_SOUND_LOW_FREQUENCY(
"<b>Shiny Sound Low Frequency (Hz):</b><br>High pass filter frequency for shiny sound.",
LockMode::LOCK_WHILE_RUNNING,
5000, 0, 48000
)
{
PA_ADD_STATIC(m_soft_reset_timings);
PA_ADD_OPTION(START_BUTTON_MASH);
PA_ADD_OPTION(ENTER_GAME_WAIT);
PA_ADD_STATIC(m_shiny_audio_settings);
PA_ADD_OPTION(SHINY_SOUND_THRESHOLD);
PA_ADD_OPTION(SHINY_SOUND_LOW_FREQUENCY);
}





GameSettings_Descriptor::GameSettings_Descriptor()
: PanelDescriptor(
Color(),
"PokemonRSE:GlobalSettings",
"Pokemon RSE", "Pokemon Settings",
"ComputerControl/blob/master/Wiki/Programs/PokemonRSE/RSESettings.md",
"Global Pokemon RSE Settings"
)
{}



GameSettingsPanel::GameSettingsPanel(const GameSettings_Descriptor& descriptor)
: SettingsPanelInstance(descriptor)
, settings(GameSettings::instance())
{
PA_ADD_OPTION(settings);
}





}
}
}






59 changes: 59 additions & 0 deletions SerialPrograms/Source/PokemonRSE/PokemonRSE_Settings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* Pokemon RSE Settings
*
* From: https://github.com/PokemonAutomation/Arduino-Source
*
*/

#ifndef PokemonAutomation_PokemonRSE_Settings_H
#define PokemonAutomation_PokemonRSE_Settings_H

#include "Common/Cpp/Options/StaticTextOption.h"
#include "Common/Cpp/Options/BooleanCheckBoxOption.h"
#include "Common/Cpp/Options/FloatingPointOption.h"
#include "Common/Cpp/Options/TimeExpressionOption.h"
#include "CommonFramework/Panels/SettingsPanel.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonRSE{


class GameSettings : public BatchOption{
GameSettings();
public:
static GameSettings& instance();

SectionDividerOption m_menu_navigation;
TimeExpressionOption<uint16_t> GAME_TO_HOME_DELAY;

SectionDividerOption m_soft_reset_timings;
TimeExpressionOption<uint16_t> START_BUTTON_MASH;
TimeExpressionOption<uint16_t> ENTER_GAME_WAIT;

SectionDividerOption m_shiny_audio_settings;
FloatingPointOption SHINY_SOUND_THRESHOLD;
FloatingPointOption SHINY_SOUND_LOW_FREQUENCY;

};




class GameSettings_Descriptor : public PanelDescriptor{
public:
GameSettings_Descriptor();
};


class GameSettingsPanel : public SettingsPanelInstance{
public:
GameSettingsPanel(const GameSettings_Descriptor& descriptor);
private:
GameSettings& settings;
};


}
}
}
#endif