Skip to content

Commit cd45734

Browse files
committed
Fix implementation of skipping black border check for GBA.
1 parent a82c1f0 commit cd45734

11 files changed

+69
-15
lines changed

SerialPrograms/Source/NintendoSwitch/Framework/NintendoSwitch_MultiSwitchProgramSession.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ void MultiSwitchProgramSession::run_program_instance(MultiSwitchProgramEnvironme
9797
);
9898
m_option.instance().start_program_border_check(
9999
scope,
100-
env.consoles[c], c
100+
env.consoles[c], c,
101+
m_option.descriptor().feedback()
101102
);
102103
}
103104

SerialPrograms/Source/NintendoSwitch/Framework/NintendoSwitch_SingleSwitchProgramSession.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,17 @@ void SingleSwitchProgramSession::run_program_instance(SingleSwitchProgramEnviron
6060
}
6161

6262
// Startup Checks
63-
m_option.instance().start_program_controller_check(scope, m_system.controller_session());
64-
m_option.instance().start_program_feedback_check(scope, env.console, m_option.descriptor().feedback());
65-
if (m_option.descriptor().category() != Pokemon::STRING_POKEMON + " RSE"
66-
&& m_option.descriptor().category() != Pokemon::STRING_POKEMON + " FRLG"){
67-
m_option.instance().start_program_border_check(scope, env.console);
68-
}
63+
m_option.instance().start_program_controller_check(
64+
scope, m_system.controller_session()
65+
);
66+
m_option.instance().start_program_feedback_check(
67+
scope, env.console,
68+
m_option.descriptor().feedback()
69+
);
70+
m_option.instance().start_program_border_check(
71+
scope, env.console,
72+
m_option.descriptor().feedback()
73+
);
6974

7075
m_scope.store(&scope, std::memory_order_release);
7176

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_MultiSwitchProgram.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,17 @@ void MultiSwitchProgramInstance::start_program_feedback_check(
144144
}
145145
void MultiSwitchProgramInstance::start_program_border_check(
146146
CancellableScope& scope,
147-
VideoStream& stream, size_t console_index
147+
VideoStream& stream, size_t console_index,
148+
FeedbackType feedback_type
148149
){
149-
StartProgramChecks::check_border(stream);
150+
switch (feedback_type){
151+
case FeedbackType::NONE:
152+
case FeedbackType::OPTIONAL_:
153+
return;
154+
case FeedbackType::REQUIRED:
155+
case FeedbackType::VIDEO_AUDIO:
156+
StartProgramChecks::check_border(stream);
157+
}
150158
}
151159

152160

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_MultiSwitchProgram.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ class MultiSwitchProgramInstance{
147147
);
148148
virtual void start_program_border_check(
149149
CancellableScope& scope,
150-
VideoStream& stream, size_t console_index
150+
VideoStream& stream, size_t console_index,
151+
FeedbackType feedback_type
151152
);
152153

153154

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_SingleSwitchProgram.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,17 @@ void SingleSwitchProgramInstance::start_program_feedback_check(
8989
}
9090
void SingleSwitchProgramInstance::start_program_border_check(
9191
CancellableScope& scope,
92-
VideoStream& stream
92+
VideoStream& stream,
93+
FeedbackType feedback_type
9394
){
94-
StartProgramChecks::check_border(stream);
95+
switch (feedback_type){
96+
case FeedbackType::NONE:
97+
case FeedbackType::OPTIONAL_:
98+
return;
99+
case FeedbackType::REQUIRED:
100+
case FeedbackType::VIDEO_AUDIO:
101+
StartProgramChecks::check_border(stream);
102+
}
95103
}
96104

97105

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_SingleSwitchProgram.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ class SingleSwitchProgramInstance{
130130
);
131131
virtual void start_program_border_check(
132132
CancellableScope& scope,
133-
VideoStream& stream
133+
VideoStream& stream,
134+
FeedbackType feedback_type
134135
);
135136

136137

SerialPrograms/Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_AudioStarterReset.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ class AudioStarterReset : public SingleSwitchProgramInstance{
2626
AudioStarterReset();
2727
virtual void program(SingleSwitchProgramEnvironment& env, ProControllerContext& context) override;
2828

29+
virtual void start_program_border_check(
30+
CancellableScope& scope,
31+
VideoStream& stream,
32+
FeedbackType feedback_type
33+
) override{}
34+
2935
private:
3036
enum class Target{
3137
treecko,

SerialPrograms/Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_LegendaryHunt-Emerald.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ class LegendaryHuntEmerald : public SingleSwitchProgramInstance{
2828
LegendaryHuntEmerald();
2929
virtual void program(SingleSwitchProgramEnvironment& env, ProControllerContext& context) override;
3030

31+
virtual void start_program_border_check(
32+
CancellableScope& scope,
33+
VideoStream& stream,
34+
FeedbackType feedback_type
35+
) override{}
36+
3137
private:
3238
enum class Target{
3339
regis,

SerialPrograms/Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_ShinyHunt-Deoxys.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ class ShinyHuntDeoxys : public SingleSwitchProgramInstance{
2727
ShinyHuntDeoxys();
2828
virtual void program(SingleSwitchProgramEnvironment& env, ProControllerContext& context) override;
2929

30+
virtual void start_program_border_check(
31+
CancellableScope& scope,
32+
VideoStream& stream,
33+
FeedbackType feedback_type
34+
) override{}
35+
3036
private:
3137
enum class StartPos{
3238
boat,

SerialPrograms/Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_StarterReset.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef PokemonAutomation_PokemonRSE_StarterReset_H
88
#define PokemonAutomation_PokemonRSE_StarterReset_H
99

10-
#include "Common/Cpp/Options/TimeDurationOption.h"
10+
//#include "Common/Cpp/Options/TimeDurationOption.h"
1111
#include "CommonFramework/Notifications/EventNotificationsTable.h"
1212
#include "NintendoSwitch/NintendoSwitch_SingleSwitchProgram.h"
1313

@@ -27,6 +27,12 @@ class StarterReset : public SingleSwitchProgramInstance{
2727
StarterReset();
2828
virtual void program(SingleSwitchProgramEnvironment& env, ProControllerContext &context) override;
2929

30+
virtual void start_program_border_check(
31+
CancellableScope& scope,
32+
VideoStream& stream,
33+
FeedbackType feedback_type
34+
) override{}
35+
3036
private:
3137
enum class Target{
3238
treecko,

0 commit comments

Comments
 (0)