Skip to content

Commit 7c8bb8f

Browse files
committed
Refactor BotBaseHandle.
1 parent 7f818a9 commit 7c8bb8f

File tree

7 files changed

+267
-226
lines changed

7 files changed

+267
-226
lines changed

SerialPrograms/Source/CommonFramework/Options/Environment/ThemeSelectorOption.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ Color theme_friendly_darkblue(){
7979
}
8080
#endif
8181
std::string html_color_text(const std::string& text, Color color){
82+
if (color == Color()){
83+
return text;
84+
}
8285
const char HEX[] = "0123456789abcdef";
8386
uint32_t rgb = (uint32_t)color;
8487
std::string str;

SerialPrograms/Source/Controllers/SerialPABotBase/SerialPABotBase.cpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const char NintendoSwitch_Basic[] = "NintendoSwitch-SerialPABotBase";
1919
const char* to_string(Features feature){
2020
switch (feature){
2121
case Features::TickPrecise: return "TickPrecise";
22+
case Features::QueueSize: return "QueueSize";
2223
case Features::NintendoSwitch_Basic: return "NintendoSwitch_Basic";
2324
case Features::NintendoSwitch_SSF: return "NintendoSwitch_SSF";
2425
case Features::NintendoSwitch_Macros: return "NintendoSwitch_Macros";
@@ -66,6 +67,49 @@ std::set<std::string> program_id_to_features(uint8_t id){
6667

6768

6869

70+
const std::map<
71+
uint32_t, // Program ID
72+
std::map<
73+
uint32_t, // Protocol Version
74+
std::set<Features>
75+
>
76+
> SUPPORTED_VERSIONS{
77+
{2021052600, {
78+
{PABB_PID_UNSPECIFIED, {}},
79+
{PABB_PID_PABOTBASE_12KB, {
80+
Features::TickPrecise,
81+
Features::NintendoSwitch_Basic,
82+
Features::NintendoSwitch_SSF,
83+
Features::NintendoSwitch_Macros,
84+
}},
85+
{PABB_PID_PABOTBASE_31KB, {
86+
Features::TickPrecise,
87+
Features::NintendoSwitch_Basic,
88+
Features::NintendoSwitch_SSF,
89+
Features::NintendoSwitch_Macros,
90+
Features::NintendoSwitch_DateSkip,
91+
}},
92+
}},
93+
{2023121900, {
94+
{PABB_PID_UNSPECIFIED, {}},
95+
{PABB_PID_PABOTBASE_12KB, {
96+
Features::TickPrecise,
97+
Features::QueueSize,
98+
Features::NintendoSwitch_Basic,
99+
Features::NintendoSwitch_SSF,
100+
Features::NintendoSwitch_Macros,
101+
Features::NintendoSwitch_DateSkip,
102+
}},
103+
{PABB_PID_PABOTBASE_31KB, {
104+
Features::TickPrecise,
105+
Features::QueueSize,
106+
Features::NintendoSwitch_Basic,
107+
Features::NintendoSwitch_SSF,
108+
Features::NintendoSwitch_Macros,
109+
Features::NintendoSwitch_DateSkip,
110+
}},
111+
}},
112+
};
69113

70114

71115

SerialPrograms/Source/Controllers/SerialPABotBase/SerialPABotBase.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <stdint.h>
1111
#include <string>
1212
#include <set>
13+
#include <map>
1314

1415
namespace PokemonAutomation{
1516
namespace SerialPABotBase{
@@ -22,6 +23,7 @@ extern const char NintendoSwitch_Basic[];
2223
// Feature List
2324
enum class Features{
2425
TickPrecise,
26+
QueueSize,
2527
NintendoSwitch_Basic,
2628
NintendoSwitch_SSF,
2729
NintendoSwitch_Macros,
@@ -41,6 +43,15 @@ std::set<std::string> program_id_to_features(uint8_t id);
4143

4244

4345

46+
extern const std::map<
47+
uint32_t, // Protocol Version
48+
std::map<
49+
uint32_t, // Program ID
50+
std::set<Features>
51+
>
52+
> SUPPORTED_VERSIONS;
53+
54+
4455

4556
}
4657
}

0 commit comments

Comments
 (0)